Results 1 to 4 of 4

Thread: Simple animation using timer only.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Simple animation using timer only.

    Hi, I remember there is a way to do simple animation using only a timer and a picture box. Where you load in a picture into the box every whatever seconds and it makes an animation. Does anybody know how to do that. I remember it's something like:

    Timer1.interval - tickcount..blah balh blah.

    Please help. Thanks!

  2. #2
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Hum you must be confused, because if you're using GetTickCount() you won't need any timers

    So, you want a simple animation? Do you wanna use APIs or pure VB?
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202
    Actually I'm doing this for a DirectX game. I just want to know the simple logic.

    Thanks

  4. #4
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    For a DirectX game you should use GetTickCount. Here's the pice of code I'm using; it's in the beggining of the main loop (inside the Do...Loop thingy):

    VB Code:
    1. 'Slow down the FPS...
    2.         Do
    3.             DoEvents
    4.         Loop Until GetTickCount() >= LastTick + TicksPerFrame
    5.         LastTick = GetTickCount()

    You'll have to declare LastTick and TicksPerFrame as Long (unless you wanna use another slow type ). TicksPerFrame is the number of miliseconds that each frame will last - usually 30 is a good number
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width