Public Member Functions | |
| Entity (String n) | |
| boolean | addModule (String n, GameModule m) |
| void | ponder (float t) |
| void | render (Graphics g) |
| String | getName () |
| GameModule | getModule (String name) |
| int | getLayer () |
| void | setLayer (int z) |
| float | getX () |
| int | getGridX () |
| void | setX (float x) |
| float | getY () |
| int | getGridY () |
| void | setY (float y) |
| boolean | testGrid (int x, int y) |
| boolean | isPlayerControlled () |
| void | setPlayerControlled (boolean value) |
Definition at line 33 of file Entity.java.
| org.classroomgaming.cgp.Entity.Entity | ( | String | n | ) |
Named constructor for game object
| n | Name of the new object |
Definition at line 48 of file Entity.java.
| boolean org.classroomgaming.cgp.Entity.addModule | ( | String | n, | |
| GameModule | m | |||
| ) |
Adds a new module to the Game Object
| n | Name of the new module | |
| m | Module to add |
true if added successfully, false otherwise Definition at line 63 of file Entity.java.
| int org.classroomgaming.cgp.Entity.getGridX | ( | ) |
Get the object's x-position rounded to nearest integer
Definition at line 151 of file Entity.java.
| int org.classroomgaming.cgp.Entity.getGridY | ( | ) |
Get the objects current y position rounded to nearest integer
Definition at line 175 of file Entity.java.
| int org.classroomgaming.cgp.Entity.getLayer | ( | ) |
Get the object's layer, or z-position
Definition at line 127 of file Entity.java.
| GameModule org.classroomgaming.cgp.Entity.getModule | ( | String | name | ) |
Request a GameObjectModule by name
| name | Name of the module, assigned with add |
Definition at line 119 of file Entity.java.
| String org.classroomgaming.cgp.Entity.getName | ( | ) |
Public accessor for name
Definition at line 110 of file Entity.java.
| float org.classroomgaming.cgp.Entity.getX | ( | ) |
Get the object's x-position (positive values to right)
Definition at line 143 of file Entity.java.
| float org.classroomgaming.cgp.Entity.getY | ( | ) |
Get the object's current y position (positive values down)
Definition at line 167 of file Entity.java.
| boolean org.classroomgaming.cgp.Entity.isPlayerControlled | ( | ) |
Determine if object is player controlled
true if player controlled, false otherwise Definition at line 200 of file Entity.java.
| void org.classroomgaming.cgp.Entity.ponder | ( | float | t | ) |
Timed update procedure, which updates each module in turn
| t | time elapsed in seconds |
Definition at line 75 of file Entity.java.
| void org.classroomgaming.cgp.Entity.render | ( | Graphics | g | ) |
Render the current object on the screen
| app | Source Java Applet | |
| g | Graphics object to render to |
Definition at line 94 of file Entity.java.
| void org.classroomgaming.cgp.Entity.setLayer | ( | int | z | ) |
| void org.classroomgaming.cgp.Entity.setPlayerControlled | ( | boolean | value | ) |
Modify player controlled flag
| value | true if player controlled, false otherwise |
Definition at line 208 of file Entity.java.
| void org.classroomgaming.cgp.Entity.setX | ( | float | x | ) |
Change the object's x position
| x | New x position |
Definition at line 159 of file Entity.java.
| void org.classroomgaming.cgp.Entity.setY | ( | float | y | ) |
Change the object's current y position
| y | new y position |
Definition at line 183 of file Entity.java.
| boolean org.classroomgaming.cgp.Entity.testGrid | ( | int | x, | |
| int | y | |||
| ) |
Check to see if current object is in a specified grid tile
| x | horizonal position (+right) | |
| y | vertical position (+down) |
Definition at line 192 of file Entity.java.
1.5.8