casarock Posted September 29, 2015 Share Posted September 29, 2015 Hi! I'm currently working on a prototype for some kind of endless runner like Jet PAck Joyride. I just want to have several Backgorund "stitched" together to have some kind of veriety (like Jetpack Joyride). There are three "buffers" holding a texture, slightly bigger than screen size. they are added as Sprites and I move them using decreasing x in my update function. If a buffer is out of sight, I'm changing the sprite texture and set new x. I've got a continuos scrolling background with changing patterns. This part works very good. All I want to ask: Am I on the right way or is this a performance killer? On Firefox 40 (OS X) I'm have just ~40-50FPS. Just scrolling backgrounds, nothing else added. Edit: Here is my actual result: http://l.appsbu.de/runner/ Link to comment Share on other sites More sharing options...
Blue-EyesWhiteDragon Posted September 29, 2015 Share Posted September 29, 2015 On 29/09/2015 at 9:36 PM, casarock said: All I want to ask: Am I on the right way or is this a performance killer? On Firefox 40 (OS X) I'm have just ~40-50FPS. Just scrolling backgrounds, nothing else added. I ran this on my 4.1GHz Quad Core (16GB RAM DDR3), 2.4GHz Dual Core (6GB RAM DDR3), 1.1GHz Dual Core (4GB RAM DDR3) Windows devices and the results are respectively as follows: (1): ~45fps Firefox 43a02, ~48fps Google Chrome 45.0.2454 (2): ~34fps Firefox 43a02, ~35fps Google Chrome 45.0.2454 (3): ~26fps Firefox 43a02, ~29fps Google Chrome 45.0.2454 I guess for low end devices it's bearable, but it does seem quite slow (all the tests had no additional programs active). Link to comment Share on other sites More sharing options...
MichaelD Posted September 29, 2015 Share Posted September 29, 2015 If the backgrounds are all the same you should try adding tile sprites with the http://phaser.io/docs/2.4.3/Phaser.TileSprite.html#autoScroll function. This will create a background that always scrolls and repeats. Link to comment Share on other sites More sharing options...
jmp909 Posted September 29, 2015 Share Posted September 29, 2015 Out of interest...my Chrome says 60 for the render fps .. and Firefox 59/60fps, but the movement is quite jerky rather than continually smooth... so is that: a ) a faulty FPS meterb ) movement that's not actually sync'd to the framerate for some reasonc ) my graphics drivers not working :S thanksj Link to comment Share on other sites More sharing options...
Recommended Posts