first commit

This commit is contained in:
Matteo Benedetto
2024-12-05 23:30:16 +01:00
commit b89c4ae375
781 changed files with 300 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
class Unit:
"""
A class to represent a unit in the game.
Attributes
----------
position : tuple
The current position of the unit (default is (0, 0)).
position_before : tuple
The position of the unit before the last update.
state : int
The current state of the unit (default is 0).
speed : float
The delay between updates in seconds (default is 0.05).
partial_move : int
The partial move value (default is 0).
Methods
-------
__init__(self, position=(0,0))
Initializes the unit with a given position.
"""
def __init__(self, position=(0,0)):
self.position = position
self.position_before = self.position
self.state = 0
self.partial_move = 1