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.

Newcomers DBPro Corner / falling off the matrix

Author
Message
zipbob
20
Years of Service
User Offline
Joined: 8th Jan 2004
Location: hell
Posted: 8th Jan 2004 19:09
can anyone tell me how to stop my player model from walking off the edge of the matrix [center]

the end
zipbob
20
Years of Service
User Offline
Joined: 8th Jan 2004
Location: hell
Posted: 8th Jan 2004 19:12
i have darkBASIC classic, not pro

the end
Doremar
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 8th Jan 2004 20:22
I haven't gotten this far yet myself, but it occurs to me that you could either set up walls with collision at the edge of the matrix, or (probably easier) just define maximum x and y coordinates for the character in the game loop that would keep the character from moving that far.

Ya folla? If you're not sure how to do this I might be able to provide a code example later.

A Cloaking Robe of Elven-Kind hangs in my wardrobe behind
All those things that mother said were proper for a boy
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 8th Jan 2004 22:49
Supposing your matrix is 10000x10000 and it is positioned at 0,0,0, and x# and z# are your player positioning variables, put this in the main loop:

if x#<0 then x#=0
if x#>10000 then x#=10000
if z#<0 then z#=0
if z#>10000 then z#=10000
zipbob
20
Years of Service
User Offline
Joined: 8th Jan 2004
Location: hell
Posted: 9th Jan 2004 23:57
thnx a lot, both of u, my game now actually works!
ta

the end

Login to post a reply

Server time is: 2024-11-25 23:29:24
Your offset time is: 2024-11-25 23:29:24