JokerJESUS Posted December 20, 2015 Share Posted December 20, 2015 Hello, i have a problem with shooting in my game, similar problem is in this example:http://www.phaser.io/examples/v2/games/tanks As you can see, when pointer is far of point when bullets are spawning than this is working fine, but when you get you pointer close to point where bullets are spawning than bullets are getting in a SLOWMOTION! They are moving really slow, sorry for my english. Link to comment Share on other sites More sharing options...
RedPanduzer Posted December 21, 2015 Share Posted December 21, 2015 I suggest you start reading Phaser API. There you will find good documentation for Phaser that will help you with this kind of issues.http://phaser.io/docs/2.4.4/Phaser.Physics.Arcade.html#moveToPointerIf you take a closer look for that last parameter you will notice that it's a fixed time to dictate time it will take for object to arrive at target.So, if you set this for, let's say 500ms (0.5s) and your cursor is 400 pixels away from the gun, object will travel that 400 pixels in 500ms. Now if your cursor is 10pixel away, it will still take 500ms to travel that short distance of 10px and thats why it looks like "slowmotion". Link to comment Share on other sites More sharing options...
JokerJESUS Posted December 21, 2015 Author Share Posted December 21, 2015 Thanks, i got it. In maxTime i set 0; Link to comment Share on other sites More sharing options...
Recommended Posts