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

2013/11/22

Going through an object on the side while it shouldn't

1
2
danpost danpost

2013/11/25

#
What you could do, is create a new method (a modification of the 'fall' method, which deals with vertical movement) to control the horizontal movement (using 'getOneObjectAtOffset(getX(), getY()+Math.signum(speed), balk.class)').
Foppen Foppen

2013/11/26

#
And that would prevent from going into the object?
danpost danpost

2013/11/26

#
Foppen wrote...
And that would prevent from going into the object?
Well, it does not go into the object from above or below.
Foppen Foppen

2013/11/26

#
It's already like that, the problem are the sides..
danpost danpost

2013/11/27

#
I think you lost context of where the discussion was going. I am suggesting that you duplicate (with some modifications) the 'fall' method so that horizontal movement will be controlled just as the horizontal movement is currently controlled.
Foppen Foppen

2013/11/27

#
Already found a solution myself. Thanks for your help anyway.
You need to login to post a reply.
1
2