This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
tennis097
wrote ...
2021/6/14
how can i test for this scenerio
tennis097
2021/6/14
#
public void changeDirection() { if ((this.getGridY() == this.getWorld().getHeight()) || (this.getGridX() == this.getWorld().getWidth())) { this.uTurn(); this.move(); }
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.
X