You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
777 B
27 lines
777 B
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
|
|
|