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

2021/6/14

how can i test for this scenerio

tennis097 tennis097

2021/6/14

#
public void changeDirection() { if ((this.getGridY() == this.getWorld().getHeight()) || (this.getGridX() == this.getWorld().getWidth())) { this.uTurn(); this.move(); }
danpost danpost

2021/6/14

#
If your world is bounded, then the greatest x is getWorld().getWidth() -1 , and the greatest y is getWorld().getHeight() -1 .
You need to login to post a reply.