Creepy-simulation
 
Loading...
Searching...
No Matches
creeper_drawer.CreeperDrawer Class Reference
Inheritance diagram for creeper_drawer.CreeperDrawer:

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
 

Detailed Description

@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.

Constructor & Destructor Documentation

◆ __init__()

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.

Member Function Documentation

◆ set_img()

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.

◆ update()

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.

Member Data Documentation

◆ cur_x

creeper_drawer.CreeperDrawer.cur_x

◆ cur_y

creeper_drawer.CreeperDrawer.cur_y

◆ dx

creeper_drawer.CreeperDrawer.dx

◆ image

creeper_drawer.CreeperDrawer.image

◆ state

creeper_drawer.CreeperDrawer.state

◆ steps_left

creeper_drawer.CreeperDrawer.steps_left

◆ target_x

creeper_drawer.CreeperDrawer.target_x

◆ target_y

creeper_drawer.CreeperDrawer.target_y

The documentation for this class was generated from the following file: