Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / walls surrounding matrix

Author
Message
paulkay
17
Years of Service
User Offline
Joined: 11th Jul 2007
Location:
Posted: 2nd Sep 2007 15:41
how do i make walls around my matrix so that the character wont walk off the map???? code maybe??? thanks...
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Sep 2007 17:38
all you need to know is the position of your matrix and how large it is, then just put in binders like this:


you'll want to put this just after the position variables of your character have been modified (use variables if you aren't), and just before his position is updated to the screen.

In programming, nothing exists
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Sep 2007 02:11
That will work, but the down side is that when you reach the edges of the matrix you can see out into the 'void'.

A slightly better method is to extend what OBese87 says and alter the height of the matrix along the four edges to create a raised 'skirt':



TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Sep 2007 02:41
Here's an example using a wall.



This also uses the player position on the matrix, though you could use collision between the player and the wall, though in this case I don't think it's worth it.

TDK_Man

Login to post a reply

Server time is: 2025-05-31 19:05:53
Your offset time is: 2025-05-31 19:05:53