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 / Player Input, storing movement commands and then execute them?

Author
Message
Tucker
14
Years of Service
User Offline
Joined: 20th Jun 2010
Location: Earth Prime
Posted: 27th Sep 2010 04:55
Hey,
Does anyone have a clue on how to code an input system where the player presses, 6 directional commands,e.g up, left, up, up left, right, up etc, and then after x amount of time, an object performs those commands? I just can't figure it out for some reason, i bet its super simple and i'm just retarded.

Bow Chika Bow Wow
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Sep 2010 07:48 Edited at: 27th Sep 2010 08:00
You can create a queue that holds all the commands you want the object to do until the timer is up. I generally don't work with 3D stuff so I made a program using a sprite. When you press any arrow key it'll store numbers that represent up, down, left, and right. When 10 seconds are up it'll go through the whole queue and extract each of those numbers to move the sprite in the order they were added to the queue.

Just for fun I added rotating of the sprite too so press z to rotate left and x to rotate right. I'll let you do the 3D conversion.



Tucker
14
Years of Service
User Offline
Joined: 20th Jun 2010
Location: Earth Prime
Posted: 27th Sep 2010 10:02
That is more than what i've asked for, thankyou so much.
Attempting a simple turn based pvp game. Cheers again Grog!

Bow Chika Bow Wow

Login to post a reply

Server time is: 2024-11-24 11:13:40
Your offset time is: 2024-11-24 11:13:40