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

Leaderchicken's Comments

Back to Leaderchicken's profile

Oh and dont forget Greenfoot standard is that setRotation(0) faces your plane to the right so the face off the image should be drawn towards the right(just use a programm like photophiltre to mirror the image).
For coding style it would be better if you have one class for your planes because they will actually do the same (you can set the image with the contructor) in your checkBoundaries() method you should do all the boundarie tests in one if() . In your code you get IllegalStateExceptions because the method doesnt stop after you removed the strel out of the world. If the strel isnt in the world getY() or getX() throw this.
with move(speed) it actually works but your code throws some Exceptions
You actually use the setLocation() Method to move your "strel" so the Rotation of te Object has no effect. You should change your Strel act() to move(speed) instead of setRotation(....) then it will follow the right direction. You also should take a look abount some Methods like setRotation(getRotation) it will set the Rotation to the amount it already had.