Jump to content

Good way to increase running speed?


megamanw
 Share

Recommended Posts

I think I can safely say that increasing the fps is definitely NOT a good way to try to achieve this. FPS is likely to vary a great deal according to the capabilities of the hardware your game runs on, so is not by any means something you should expect to remain consistent, or indeed should expect to necessarily have anything like the value you request it to have. I can make a game and tell it to run at 60FPS, but if I then burden it with lots of expensive tasks to run each frame and then test it on a low-end device you can be pretty sure that 60FPS is not what I will end up with!

You can increase the playback rate of the running animation though, and the speed at which the background moves past.

Link to comment
Share on other sites

I think I can safely say that increasing the fps is definitely NOT a good way to try to achieve this. FPS is likely to vary a great deal according to the capabilities of the hardware your game runs on, so is not by any means something you should expect to remain consistent, or indeed should expect to necessarily have anything like the value you request it to have. I can make a game and tell it to run at 60FPS, but if I then burden it with lots of expensive tasks to run each frame and then test it on a low-end device you can be pretty sure that 60FPS is not what I will end up with!

You can increase the playback rate of the running animation though, and the speed at which the background moves past.

How can I do increase the playback rate???

Link to comment
Share on other sites

This will depend on what mechanism you are using to perform the animation and what framework it is built with. You might use a spritesheet based animation and a MovieClip class. My own movieclip class has a 'fps' variable that s used to determine the number of milliseconds that each frame is displayed for. If I increase the fps value this will reduce the number of milliseconds each frame is shown and therefore reduce the overall duration of the animation. Presumably frameworks like Phaser also have an equivalent MovieClip class with an equivalent fps variable.

Link to comment
Share on other sites

In addition to what @alex_h said, you could also have a timer that triggers an event such as adding '+1' to the speed you set for the moving objects (the floor/obstacles for example) at a set interval (1 second for example)

 

So if the initial speed is, say 200, then after 12 seconds it would be 212 and so on..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...