Hi all! Fairly new to greenfoot / programming, and I have hit a bit of a wall.
I need my object to change direction after it has moved +10 on the y axis, but the if statement is completely ignored by the program
Any assistance would be greatly appreciated.
Cheers!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | public void act() { move( 1 ); setRotation( 45 ); if (getY() == getY() + 10 ){ move( 1 ); setRotation( 110 ); } } |