T Posted March 18, 2016 Share Posted March 18, 2016 I have an immovable sprite. I'm scaling this sprite up with tween but I don't know how to make it push other sprites (with physics) on it's way. Any help would be appreciated. Link to comment Share on other sites More sharing options...
T Posted March 20, 2016 Author Share Posted March 20, 2016 Clone & run this repo to see what I'm trying to achieve. The wall in the middle should push the stars.https://github.com/taylankasap/phaser-tween-physics Link to comment Share on other sites More sharing options...
assafsahar123 Posted March 21, 2016 Share Posted March 21, 2016 Apparently, only when the wall has a velocity attached to its body - innerWall.body.velocity it can collide with the start and push them, but it only works at the direction of the velocity. meaning, if it has a positive velocity.x, it will push stars to the right, but will not push stars to the left. you can write: innerWall.body.velocity.x = 0.0001; innerWall.body.velocity.y = 0.0001; so the movement will not be seen, but again, this will only solve the problem in 2 directions out of 4 (right & down). Link to comment Share on other sites More sharing options...
T Posted March 21, 2016 Author Share Posted March 21, 2016 It makes sense (kinda) but still doesn't seem to work like you say. Did you maybe change something else too? Also the original question remains unanswered as what you proposed is more like a workaround. Link to comment Share on other sites More sharing options...
T Posted March 24, 2016 Author Share Posted March 24, 2016 See the gif to better understand what I'm trying to achieve (the sprite doesn't have to be a square). The square should push the stars instead of going above them. Link to comment Share on other sites More sharing options...
Recommended Posts