Added getTileOnCoord method

This commit is contained in:
Razrector 2020-04-25 22:49:57 +02:00
parent 5ca1a0b4d0
commit e37a17cadd

View File

@ -96,6 +96,13 @@ class Map:
result = entity
return result
def getTileOnCoord(self, coord):
result = None
for entity in self.terrain:
if entity.rect.x == coord[0] and entity.rect.y == coord[1]:
result = entity
return result
def addEntity(self, entity):
self.screen.draw(entity, Locations.MAP, 0, 0)
self.collidables.add(entity)