LittleMonster
LittleMonster
The Little monster class represents a little monster in the game that fires missiles and moves straight left.
This class is derived from the ArmedEntity class and implements some of its methods.
Public member functions
Member functions documentation
Constructor
The constructor of the LittleMonster class.
Parameters
room
: A reference to the room in which the little monster is.id
: The id of the little monster.x
: The x position of the little monster.y
: The y position of the little monster.pos
: A pair of short containing the position of the little monster (x, y).
refresh
This function refreshes the little monster by doing the following:
Refresh the missiles
Fire missile every ENEMY_FIRE_TIME
Move itself every ENEMY_MOVE_TIME and send the new position to all clients
collide
This function checks if the little monster or any of its missiles collide with another entity.
Parameters
other
: A reference to the entity to check collision with.
Returns
True if the little monster or any of its missiles collide with the other entity, false otherwise.