Part 2 in progress.
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
from typing import Tuple
|
||||
|
||||
class Entity:
|
||||
"""
|
||||
Generic object to represent players, enemies, items, etc.
|
||||
"""
|
||||
|
||||
def __init__(self, x, y, char, color):
|
||||
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, dy):
|
||||
def move(self, dx: int, dy: int) -> None:
|
||||
self.x += dx
|
||||
self.y += dy
|
||||
Reference in New Issue
Block a user