The_dude8080 Posted November 8, 2016 Share Posted November 8, 2016 Hey. I am using phaser arcade physics. I want to make many sprites acts as one. That means that when I press one of my cursor keys (that adds velocity) all of the sprites should be applied the same properties. I did that with a group that included all the sprites (they were about 100) and did a for each when clicked on a cursor to get each of the group children. However I think it was too slow because the sprites didn't actually move at the same (the code didn't seem to tweak fast enough). I can't add them to a "null" parent sprite because I don't want them to get fixed-in-place positions related to the parent. I want them to freely interact with each other as individual sprites but the movement should be applied to all of them when cursor keys are clicked. Any idea on how to do this? Thank you Link to comment Share on other sites More sharing options...
s4m_ur4i Posted November 10, 2016 Share Posted November 10, 2016 pasting the code would help. The normal way would be the one you already tried. what would be possible too is: make 2 variables: velX, velY. by pressing your cursor keys, assign the values you want to the variables. Each of your "movement" sprites have an update method, were you simply do: this.body.velocity.x = velX; this.body.velocity.y = velY; regards Link to comment Share on other sites More sharing options...
Recommended Posts