plicatibu Posted November 6, 2013 Share Posted November 6, 2013 Hi. Let me say the game uses sprites that will move to left / right (to run, jump, and so on). I'm wondering what is better in terms of memory / processor usage: to load images with sprites turned to both sides (like dude in starstruck example) or to load sprites turned just to one side (say left) and flip them when required. By loading sprites in all directions, user will have to wait more to start playing. That's bad (specially for low speed connections). But one will have less code (no need to flip sprites) and it can lead to lower javascript files. On the other hand, what's the cost on Phaser to flip images? Thanks. Link to comment Share on other sites More sharing options...
RestingCoder Posted November 6, 2013 Share Posted November 6, 2013 The code cost for flipping a sprite is so incredibly tiny relative to having a sprite sheet that is twice as big.Just scale the sprite to -1 in the code. plicatibu 1 Link to comment Share on other sites More sharing options...
plicatibu Posted November 6, 2013 Author Share Posted November 6, 2013 Good to know. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts