moving a wall
dufdavid
Member Posts: 28
Hi, how to move an object in only one direction when an actor collides with it? (ex: move a square wall up when you collide with the bottom and keep that new position...one way movement).
Thanks,
David
Thanks,
David
Comments
Interpolate self.positionY to 120 ( 120 being the Y position you want the actor to end at) You can set an interval for the movement so its slides up or put it at zero and it will move instantly.
And you dont need to use "collide" behavior as well..
Thanks again,
David
Note: The X,Y position of an actor is its middle. Thus you need to add or take away half its height from/to its Y to get its bottom/top edge.
Thanks all!
David
David
See if you can pull what you need from that.
http://www.resqwest.com/TEST/collide_bottom.gameproj.zip
David
I modified the same file and have it so that it moves if you bump the wall at the bottom, and will move again and again when touched until it collides with the second wall. (same download link).
Hope that helps.
David