Added getTileOnCoord method
This commit is contained in:
parent
5ca1a0b4d0
commit
e37a17cadd
@ -96,6 +96,13 @@ class Map:
|
|||||||
result = entity
|
result = entity
|
||||||
return result
|
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):
|
def addEntity(self, entity):
|
||||||
self.screen.draw(entity, Locations.MAP, 0, 0)
|
self.screen.draw(entity, Locations.MAP, 0, 0)
|
||||||
self.collidables.add(entity)
|
self.collidables.add(entity)
|
||||||
|
Loading…
Reference in New Issue
Block a user