Search the Community
Showing results for tags 'Sprite angle'.
Found 1 result
Sprite.angle and Body.rotation questionsHello there! I'm making a game to learn the phaser engine (guess what! A flappy bird again !). I got 2 images of pipes. One looking up and one looking down. I realised that since the image is the same i could save a few bytes by using the same image for the sprite but rotating it. I used sprite.angle but the problem with it is that when i apply an anchor and the physics are enabled for the pipe it fly off the screen. I used body.rotation with success on the bird sprite to animate it while flying but the problem is that it works only if i do so in the update loop. So what i ask here is either tell me a good practice to use correctly sprite.angle or tell me how i can change the body.rotation outside the update() loop. Also, what are the differences of those two? Is on of them more "expensive" in resources than the other? Which should i use for that kind of work? Here you can see the code . Thank you in advance!