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 / Need help with my game!

Author
Message
Major Payn
20
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 24th Dec 2003 22:52
Hi I am making my first 3D game and need a little help. The game is a 3d tank game. My question is, how do I have the tank rotate when I press the right and left arrow keys, then when you push the up or down arrow keys it should move in the direction it has rotated to? kind of like a real tank. I am using a flat matrix so I dont have to worry about getting the ground hight. so how do I do this? Oh yeah and My tank object is numbered 10 that will make it easier to explain. Thanks in advance.


Guns dont kill people, death kills people.
KamaKase
22
Years of Service
User Offline
Joined: 29th Oct 2002
Location:
Posted: 25th Dec 2003 00:35
if leftkey()=1 then yrotate object 10,object angle y(10)-3
if rightkey()=1 then yrotate object 10,object angle y(10)-3

rem The three's are just arbitrary units)

if upkey()=1 then move object 10,3
if downkey()=1 then move object 10,-3


That should work (haven't tested it). But that's the principal.

Login to post a reply

Server time is: 2024-11-25 21:54:28
Your offset time is: 2024-11-25 21:54:28