arctic-masher/enemies.py
PAlexanderFranklin b679393534 Add dumb enemies
2023-05-17 04:52:05 -07:00

17 lines
455 B
Python

import pygame
from constants import *
class Enemy:
def __init__(self, x, y, gameMap):
self.x = x
self.y = y
self.gameMap = gameMap
def pushed(self, x, y, caller, pusher):
if self.gameMap[self.x + x][self.y + y]:
self.gameMap[self.x + x][self.y + y].pushed(x, y, self, pusher)
self.gameMap[self.x][self.y] = 0
self.x += x
self.y += y
self.gameMap[self.x][self.y] = self