diff --git a/data/images/entities/rabbit.png b/data/images/entities/rabbit.png new file mode 100644 index 0000000..0a67152 Binary files /dev/null and b/data/images/entities/rabbit.png differ diff --git a/data/images/terrain/sand.png b/data/images/terrain/sand.png new file mode 100644 index 0000000..f2c3ec9 Binary files /dev/null and b/data/images/terrain/sand.png differ diff --git a/data/mapdata/map.txt b/data/mapdata/map.txt index 801cf61..9989e2e 100644 --- a/data/mapdata/map.txt +++ b/data/mapdata/map.txt @@ -1,20 +1,20 @@ xxxxxxxxxxxxxxxxxxxx -xwwww..w...w...ww..x -xw......w.w...w..w.x -xwwww,,,,w,,,,wwww,x -xw......w.w...w..w.x -xwwww..w...w..w..w.x -x..................x -xw...w...ww...w..wwx -xww.ww..w..w..w..w.x -xw,w,w,,wwww,,w,,wwx -xw...w..w.....w..w.x -xw...w..w.....ww.wwx -x..................x -x.w...w...ww...ww..x -x.ww.ww..w..w.w..w.x -x,w,w,w,,wwww,wwww,x -x.w...w..w..w.w....x -x.w...w..w..w.w....x -x..................x +xssssssssssssssssssx +xs................sx +xs................sx +xs................sx +xs................sx +xs.....wwwwww.....sx +xs.....w,,,,w.....sx +xs.....w,,,,w.....sx +xs.....ww,,ww.....sx +xs................sx +xs................sx +xs................sx +xs................sx +xs................sx +xs................sx +xs................sx +xs................sx +xssssssssssssssssssx xxxxxxxxxxxxxxxxxxxx \ No newline at end of file diff --git a/src/entities/Pickupable.py b/src/entities/Pickupable.py index 319daa1..cae4981 100644 --- a/src/entities/Pickupable.py +++ b/src/entities/Pickupable.py @@ -1,10 +1,10 @@ -import src.entities.Interactable as Interactable from src.entities import Statistics, Player -from game.MapNew import Map +from src.entities.Interactable import Interactable + class Pickupable(Interactable): - def __init__(self, texture, pos, id, Statistics): - super().__init__(texture, pos, id) + def __init__(self, texture, size, pos, Statistics): + super().__init__(texture, size, pos) self.is_pickupable = True self.Statistics = Statistics @@ -14,4 +14,3 @@ class Pickupable(Interactable): Player.statistics.set_thirst(self.Statistics.thirst) Player.statistics.set_hunger(self.Statistics.hunger) - Map.removeSpriteFromMap(self) diff --git a/src/game/Map.py b/src/game/Map.py index d2ea4fd..a8408d7 100644 --- a/src/game/Map.py +++ b/src/game/Map.py @@ -60,10 +60,8 @@ class Map: def terrainDraw(self): for row, tiles in enumerate(self.terrain): for col, tile in enumerate(tiles): - if tile == 'w': - object = TerrainTile(col, row, 'wall.png', self.tileSize) - self.screen.draw(object, Locations.MAP, 0, 0) - self.collidables.add(object) + if tile == 's': + self.screen.draw(TerrainTile(col, row, 'sand.png', self.tileSize), Locations.MAP, 0, 0) elif tile == ',': self.screen.draw(TerrainTile(col, row, 'floor.png', self.tileSize), Locations.MAP, 0, 0) elif tile == '.': @@ -72,6 +70,10 @@ class Map: object = TerrainTile(col, row, 'water.jpg', self.tileSize) self.screen.draw(object, Locations.MAP, 0, 0) self.collidables.add(object) + elif tile == 'w': + object = TerrainTile(col, row, 'wall.png', self.tileSize) + self.screen.draw(object, Locations.MAP, 0, 0) + self.collidables.add(object) def addEntity(self, entity): self.screen.draw(entity, Locations.MAP, 0, 0)