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

2013/12/27

Help with offset pls

bzhang bzhang

2013/12/27

#
HorizontalWall htop = (HorizontalWall)getOneObjectAtOffset(0, 8, HorizontalWall.class); if(htop != null && getRotation()==SOUTH){ speed = 0; } I have this code, and it doesn't work. Can someone help me. I have a speed variable, and I have north south east and west constants. When my character touches the top of the wall and is moving down, he doesn't stop.
danpost danpost

2013/12/27

#
I will presume that EAST = 0, SOUTH = 90, WEST = 180 and NORTH = 270. Beyond that, I would need to see the code for the class, because the two statements above appear to be ok; although context might find this code faulty.
You need to login to post a reply.