Public Member Functions | |
| __init__ (self, tuple[float, float] position, CreeperState state, drawer) | |
| set_img (self, prev) | |
| update (self, tuple[float, float] new_position, steps, state=None) | |
Public Attributes | |
| dx | |
| state | |
| image | |
| cur_x | |
| cur_y | |
| target_x | |
| target_y | |
| steps_left | |
@class CreeperDrawer @brief Manages the rendering and state transitions of individual creepers. The CreeperDrawer class extends the EntityDrawer to handle specific behaviors and visuals associated with creepers.
| creeper_drawer.CreeperDrawer.__init__ | ( | self, | |
| tuple[float, float] | position, | ||
| CreeperState | state, | ||
| drawer | |||
| ) |
Initializes a CreeperDrawer object. @param position: The initial position of the creeper. @param state: The current state of the creeper (e.g., Walk, Born, Sleep). @param drawer: The drawer object managing rendering.
| creeper_drawer.CreeperDrawer.set_img | ( | self, | |
| prev | |||
| ) |
Updates the image associated with the creeper based on its current state. @param prev: The previous state of the creeper.
| creeper_drawer.CreeperDrawer.update | ( | self, | |
| tuple[float, float] | new_position, | ||
| steps, | |||
state = None |
|||
| ) |
Updates the position and state of the creeper. @param position: The new position of the creeper. @param state: The new state of the creeper.
| creeper_drawer.CreeperDrawer.cur_x |
| creeper_drawer.CreeperDrawer.cur_y |
| creeper_drawer.CreeperDrawer.dx |
| creeper_drawer.CreeperDrawer.image |
| creeper_drawer.CreeperDrawer.state |
| creeper_drawer.CreeperDrawer.steps_left |
| creeper_drawer.CreeperDrawer.target_x |
| creeper_drawer.CreeperDrawer.target_y |