Jump to content
  • Advertisement


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


VB 5.0 Timer / Animation Problem...

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

QUESTION: I am trying to insure my animation speed is the same on any computer I run my program on. Am trying to use a Timer control to do this but when I use a timer it is very slow. How can I keep my animation speeds constant on any computer? DISCUSSION: When I started writing my code I used a variable H to slow down my animation cycles of a large stone coming out the left side of the screen and reaching the center of the screen… While Z < 300 (300 was center) Screen.cls BitBlt ---- ,Z,--- screen.refresh For H = 1 to XXXX (XXXX was a number that I used to slow down in between cycles) Next H Next Z If the For H Loop was removed the animation would be near instantaneous of stone across screen. I knew that depending on your computer the XXXX would be to fast or to slow, so went to a timer control… Timer1_Timer() Z=Z+1 If Z <= 300 then Screen.cls BitBlt ---- ,Z,--- screen.refresh Else Timer1.Enabled = false End if End Sub I thought that this would allow me to control the speed by using the Timer1.Interval property but even when I set the Timer1.Interval = 1 it is very slow. Again, when I do not use Timer it is very fast. With the Timer it is to slow ?? I am only using Bitmaps although some are fairly large. Thanks for any help – Zz

Share this post

Link to post
Share on other sites
either lock the frame rate, or use frame-based modeling. if you want the animation to be slower than the fps rate, (very understandable) then you create another internal timer. this is c, but you basically do it like this:
int frame;
int timer;

while(!done) //game main loop


JoeMont001@aol.com www.polarisoft.n3.net

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!