Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Direct Input problem (please help)

This topic is 5993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ive just finished the book game programming all in one (good book), during the book you build a directX 8 engine for simple 2d games. For input it uses DX8 and uses GetDeviceState for every key on the keyboard. so if im doing a game i check the state of a key using this function and then do whatever depending on that. Now theres a small physics engine in the book and to move an object i would check the state of the keyboard and then use a function such as applyLinearForce() to this object. however i want to do a game using grid based movement so if the left key was pressed id do if(!AtFarthestXPoint) xPos+=1; this isnt the actual code obviously the problem is pressing the key once will move the object to the furthest x position. So i was wondering if there was away to slow this down, ive tried setting the key to 0 in the buffer i pass to GetDeviceState() thanks in advance

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!