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 / DBP: object movement (y axis)

Author
Message
Sonic 91 Software
19
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 4th Apr 2007 23:53
I am developing a simple world creation engine for an adventure game I'm working on. However, I am trying to make the cursor object move up and down the y axis on a keypress, but it stays at its default y position of 0. the other movement works fine.


do
ox#=object position x(1)
oy#=object position y(1)
oz#=object position z(1)
if upkey()=1 then move object 1,2
if downkey()=1 then move object 1,-2
if leftkey()=1 then turn object left 1,2:dec ang,2
if rightkey()=1 then turn object right 1,2:inc ang,2
if spacekey()=1 then oy#=oy#+1
if shiftkey()=1 then oy#=oy#-1
ang=wrapvalue(ang)
set camera to follow ox#,oy#,oz#,ang,30,10,10,0
sync
loop


it's definitely a noob-type mistake, but I am not a noob!

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12
Johaness
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location:
Posted: 5th Apr 2007 00:26
position object 1, ox#, oy# + 1, oz#
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 5th Apr 2007 02:24
Since you're already using the move object commands everywhere else, you could change two lines:

Sonic 91 Software
19
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 5th Apr 2007 11:40
thanks, crit, that works. and thanks, johaness for your suggestion too.

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12

Login to post a reply

Server time is: 2024-11-25 20:46:29
Your offset time is: 2024-11-25 20:46:29