Appendix B. Greenfoot API
The Greenfoot API consists of five classes:
Actor | Actor methods are available to all actor subclasses. |
World | World methods are available to the world. |
Greenfoot | Used to communicate with the Greenfoot environment itself. |
MouseInfo | Provides information about the last mouse event. |
GreenfootImage | For image presentation and manipulation. |
Class World | |
---|---|
| Construct a new world. |
| Act method for the world. Called once per act round. |
| Add an Actor to the world. |
| Return the world’s background image. |
| Return the size of a cell (in pixels). |
| Return the color at the center of the ... |
Get Introduction to Programming with Greenfoot: Object–Oriented Programming in Java™ with Games and Simulations, First Edition now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.