View Poll Results: What kind of game project are you working on?

Voters
33. You may not vote on this poll
  • Nothing at all. Too busy.

    1 3.03%
  • None, just game engines or tools.

    3 9.09%
  • I make simple free stuff for fun.

    6 18.18%
  • I'm working on a commercial project and can talk about it much. (NDA, etc)

    4 12.12%
  • I'm working on my own creator-owned project.

    12 36.36%
  • I have a lot of prototypes/ideas, but I don't really have any concrete plans.

    7 21.21%
Results 1 to 10 of 52

Thread: Who is writing a game?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #25
    Quote Originally Posted by hwnd View Post
    Ok, but is it possible to take some constant and use the nxPascal "tick" to generate different animations with different framerate?
    Slower / faster.

    In my case, every block could have tile animation with his own frame rate. Some anims need slower FR, some bigger FR and still be same on any PC?
    I mean animation that has slower framerate, will be actually faster in my friends computer, who has more faster pc.
    This is demonstrated in the nxPascal demos many times. You have:
    - nx.GetTick <= Returns multiplatform GetTickCount. It is a millisecond timer running onwards, each 1000 being 1 second.
    - nx.GetTick2(range: integer; scale: single) <= Same as above, but you can limit it to certain range and scale
    - nx.FrameTick <= FPS counter called GetTick in the Flip and stored it here. You don't need to ask it from system so it could be marginally faster, but this is 1 frame late.

    What i prefer to use is the GetTick2(). For example:
    Code:
    nx.SetColor(1, 0, 0, 0.8+0.2*sin(toRad*nx.GetTick2(360, 0.5)));
    It makes a red color with alpha being in range 0.6..1.0, smoothly going by sine-wave. With range 360 it always returns value from 0.0 .. 359.5. You can use different ranges and speeds for each animation. If you want it to loop animation patterns from end to start way, you can use modulus math:

    Code:
    trunc(nx.GetTick2(4, 0.001)) mod 4
    This would return values from 0..3, like 0,1,2,3,0,1,... And being so slow that it only changes once per second.
    (actually this is going so theoretic i might have to test to verify It's how it's supposed to work though.)

    edit: Verified, returns single though.

    But naturally you can animate your stuff with like:
    Code:
    AnimPos:=AnimPos+AnimSpeed; // Where AnimSpeed is any floating point number
    With the default fixed FPS, it works same speed on every computer.
    Last edited by User137; 29-08-2012 at 07:28 PM.

Bookmarks

Posting Permissions

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