time (in milliseconds) for how long the object already exists in the game
Current rotation in radians. 0 is pointing up.
Reference to a Flag entity if the tank is currently carrying one.
Hex color code or CSS color name for the tank body.
The game instance.
Dimensional height in world pixels.
Remaining time (ms) of invincibility. If > 0, tank is immune to bullets.
Optionalmaxoptional duration in milliseconds for how long the object should still exist in the game
The player owning this tank.
If true, weapon cooldowns are significantly reduced.
Base movement speed in pixels per second. Can be modified by power-ups.
OptionaltileThe currently equipped weapon logic.
Optional inventory for future multi-weapon support.
Dimensional width in world pixels. Affects hitboxes.
Get x,y-coordinates of the tanks corners. Needed for collision detection and weapon firing.
List of corners {x, y}.
Return to the default weapon.
Deletes the tank.
Draws the tank (rotated) on map.
The context.
Properties: is invincible?
True if invincible.
Is the object marked as deleted?
Move the tank forward/backwards.
1 for forward, -1 for backward.
The time elapsed since the last frame in milliseconds.
Update the position of the object on the map
a coordinate tuple (x, y)
Use the weapon.
The time elapsed since the last frame in milliseconds.
Is the spawnshield active?
True if spawnshield active.
Let player class check for key presses and move tank. Check for collisions and handle them.
The time elapsed since the last frame in milliseconds.
Rotate the tank.
1 for right, -1 for left.
The time elapsed since the last frame in milliseconds.
Represents a Tank controlled by a player.
Receives a player in its constructor contains position, angle, speed of the tank and provides methods to move it contains methods for collision detection with walls and bullets contains a weapon and a method to shoot it