This site requires JavaScript, please enable it in your browser!
Greenfoot back
DemonsWhiteSoul
DemonsWhiteSoul wrote ...

2015/1/18

Solid Objects

DemonsWhiteSoul DemonsWhiteSoul

2015/1/18

#
How do i make an object solid / impassible when a "Player" touches it. I know i have to use getOneObejctAtOffset but then what would i need to do after that?
Super_Hippo Super_Hippo

2015/1/18

#
If it is always solid, you could check if he touches the object after he moved and if yes, walk back. You can use 'isTouching' for that. Or you check with the method you named if there is one object where you want to move and if yes, don't move.
DemonsWhiteSoul DemonsWhiteSoul

2015/1/18

#
How would i make it walk back? do i set Rotation ?
Super_Hippo Super_Hippo

2015/1/18

#
Either save the position before you walk or save the difference in x and y coordinates which you move and move that back.
danpost danpost

2015/1/18

#
DemonsWhiteSoul wrote...
How would i make it walk back? do i set Rotation ?
How does setting the rotation of the image that actor has change that actors location? There are only two Actor class methods that change the position of an actor. Please review the Actor class documentation (the methods available and what they do, in particular).
You need to login to post a reply.