18 lines
416 B
Python
18 lines
416 B
Python
|
from typing import Tuple
|
||
|
|
||
|
|
||
|
class Entity:
|
||
|
"""
|
||
|
A generic object to represent players, enemies, items, etc.
|
||
|
"""
|
||
|
def __init__(self, x: int, y: int, char: str, color: Tuple[int, int, int]):
|
||
|
self.x = x
|
||
|
self.y = y
|
||
|
self.char = char
|
||
|
self.color = color
|
||
|
|
||
|
def move(self, dx: int, dy: int):
|
||
|
# Move the entity by a given amount
|
||
|
self.x += dx
|
||
|
self.y += dy
|