Jump to content
  • Advertisement
Sign in to follow this  
DH33R4J

OpenGL Pac Man game

This topic is 3969 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

i was trying to code Pacman Game in opengl , pacman is controlled by {a,s,w,d} keys and i used system call to sleep so that the pacman moves slow , but it is not satisfactory , if i remove the sleep , it moves so fast that i hardly see it and i also want to know how to make use of arrow keys for controlling. someone help me by telling how to make it move in a controlled way. [Edited by - DH33R4J on December 4, 2007 5:47:24 AM]

Share this post


Link to post
Share on other sites
Advertisement
This isn't really an OpenGL question, i'd request it gets moved to either the general programming forum or the game programming forum. BUT, i'll do my best to answer anyways. What you want to do is use a timer. Whenever you go to the next frame, you calculate how much time has passed since the last frame, then you take that amount of time (commonly reffered to as dt or delta time) and multiply it by some constant to get the amount of movement for that frame. (the constant would be a speed)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!