17 lines
441 B
Python
17 lines
441 B
Python
from vector2 import *
|
|
from gui import *
|
|
|
|
class GameObject:
|
|
def __init__(self, position: Vector2, symbol: str) -> None:
|
|
self.__position = position
|
|
self.__symbol = symbol
|
|
|
|
@property
|
|
def position(self):
|
|
return self.__position
|
|
|
|
def move(self, direction: Vector2):
|
|
self.__position += direction
|
|
|
|
def draw(self, gui: Gui):
|
|
gui.draw(self.__position.x, self.__position.y, self.__symbol) |