Recently in class nothing has been difficult at all. I think it has something to do with the fact that we are nearing the end of the school and the curriculum is slowly finishing. AP testing is coming up, so preparation for that is likely to begin soon in the future. For the past few classes we have been working in GridWorld (something that will be prominent on our AP test). In this world, there is a grid in which actors and other sprites are able to be placed. Only one object can occupy a single spot at a certain time, but the objects can detect each other’s presence. For example, the primary actor in the program is a ladybug that moves around the screen. When the user presses step, the ladybug first checks to see whether or not it can move forward using the canMove() method. Then, if the space in front of it is clear, it moves a single spot forward. If there is an object in front of it, however, the ladybug executes the turn() method and rotates 45 degrees clockwise. This will often occur at either borders or when it contacts rocks and masks. Other methods that GridWorld include allow the user to position the sprite anywhere on the board, change the color of the sprite, and so much more. Another type of sprite that can be placed on the grid is a BoxBug, which travels in a box of specified length and height. This bug differs from the basic ladybug in that it includes two new instance variables that determine the length of the box and how many steps the bug has taken on that side. I don’t exactly know why GridWorld is so important for the AP though. It seems extremely basic to me. Every lesson can be finished within minutes of receiving it. I’m not complaining. I enjoy the free time.
Beck Out...
No comments:
Post a Comment