Hello World ! I want to move a rectangle from going one point to another point in openGl. I am reaching the position but movement is so fast when I execute the program..it already in reached state. how to add delay so that I can see moving rectangle.
pcgamer2008
0
Light Poster
Recommended Answers
Jump to PostYou can make a timer class and have it check to see if it is past your time delay between movements. If it is then add the offset then draw otherwise just draw.
I have a timer class if you would like to see/use it (its pretty basic).
Jump to PostHere is the timer class.
It is pretty easy to use. You just have to initialize a timer then set the delay using setDelay(x) (where is is in milliseconds) and then use start() to start it up. Then use checkDelay() to check to see if the timer is up …
All 6 Replies
sfuo
111
Practically a Master Poster
Foamgum
0
Newbie Poster
pcgamer2008
0
Light Poster
sfuo
111
Practically a Master Poster
pcgamer2008
commented:
Yeah ! nice ..good idea for time based game projects
+0
Khoanyneosr
0
Junior Poster in Training
pcgamer2008
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.