FryDay444 Posted December 15, 2014 Share Posted December 15, 2014 Link to example: http://bit.ly/1zoQgAn As you can see, the movement of the sprite is really choppy. I'm not doing anything complex, so I have to assume I am just doing this flat out wrong. I don't want to write an entire game if I cannot even get a sprite to move across the screen smoothly. Link to comment Share on other sites More sharing options...
clark Posted December 15, 2014 Share Posted December 15, 2014 Are you using Chrome/Canary? I have a similar issue of sluggishness but I cannot figure out why. At first I thought it was animations (dealing out cards in a card game) but this does not make much sense because 8 cards can be slow, while 20 is smooth. Link to comment Share on other sites More sharing options...
FryDay444 Posted December 15, 2014 Author Share Posted December 15, 2014 I actually have better performance under Chrome then Firefox :-/ Link to comment Share on other sites More sharing options...
JakeCake Posted December 15, 2014 Share Posted December 15, 2014 Seems perfectly smooth in Safari. I checked your source files, and it looks fine. The only thing that could cause something like that might be where you multiply with physicsElapsed, which is a good practice as it ensures same speed at all frame rates, but I'm not sure physics time updates at the same rate as the frame rate since 2.2.0. It might be 0 at some frames, then 0.016 at others or even more. Physics might be running at half that of the update loop, and they run in different threads even, I believe, so if they don't match you may seem some stepping. As this has all changed in 2.2.0+ I cannot tell you exactly what is going on, but try looking in the timer class for something else that physicsElapsed, or create your own timer for each "flame" and see how long has passed since last update. Borderline: Don't count on physicsElapsed for things that does not have to do with the physics systems, it's implementation might change from version to version. Link to comment Share on other sites More sharing options...
FryDay444 Posted December 16, 2014 Author Share Posted December 16, 2014 Wow, I just replaced the physicsElapsed call with .016 and it's MUCH better now. Does anyone know if there are any built in frame delta time functions in Phaser before I try to engineer my own? Link to comment Share on other sites More sharing options...
Recommended Posts