diff --git a/data/images/terrain/water.jpg b/data/images/terrain/water.jpg new file mode 100644 index 0000000..a7ecffe Binary files /dev/null and b/data/images/terrain/water.jpg differ diff --git a/data/mapdata/map.txt b/data/mapdata/map.txt index 606c117..801cf61 100644 --- a/data/mapdata/map.txt +++ b/data/mapdata/map.txt @@ -1,20 +1,20 @@ -.................... -..wwww..w...w...ww.. -..w......w.w...w..w. -,,wwww,,,,w,,,,wwww, -..w......w.w...w..w. -..wwww..w...w..w..w. -.................... -.w...w...ww...w..ww. -.ww.ww..w..w..w..w.. -,w,w,w,,wwww,,w,,ww, -.w...w..w.....w..w.. -.w...w..w.....ww.ww. -.................... -..w...w...ww...ww... -..ww.ww..w..w.w..w.. -,,w,w,w,,wwww,wwww,, -..w...w..w..w.w..... -..w...w..w..w.w..... -.................... -.................... \ No newline at end of file +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 +xxxxxxxxxxxxxxxxxxxx \ No newline at end of file diff --git a/src/entities/Player.py b/src/entities/Player.py index 439f38b..c47fc35 100644 --- a/src/entities/Player.py +++ b/src/entities/Player.py @@ -7,7 +7,7 @@ import pygame class Player(Entity): def __init__(self, spawnpoint, size): - super().__init__("player.jpg", size, spawnpoint) + super().__init__("player.jpg", size, (spawnpoint[0] * size, spawnpoint[1] * size)) # Where the player is facing, 0 - north, 1 self.rotation = Rotations.NORTH diff --git a/src/game/Game.py b/src/game/Game.py index 88f4647..b0573ab 100644 --- a/src/game/Game.py +++ b/src/game/Game.py @@ -42,7 +42,7 @@ class Game: self.mapDataFolder = path.dirname("../data/mapdata/") self.map = Map(path.join(self.mapDataFolder, 'map.txt'), self.screen) - self.player = Player((0, 0), self.map.tileSize) + self.player = Player((6, 2), self.map.tileSize) self.map.addEntity(self.player) self.eventManager = EventManager(self, self.player) diff --git a/src/game/Map.py b/src/game/Map.py index f0e9a9c..dbc976f 100644 --- a/src/game/Map.py +++ b/src/game/Map.py @@ -33,6 +33,10 @@ class Map: self.screen.draw(TerrainTile(col, row, 'floor.png', self.tileSize), Locations.MAP, 0, 0) elif tile == '.': self.screen.draw(TerrainTile(col, row, 'grass.png', self.tileSize), Locations.MAP, 0, 0) + elif tile == 'x': + object = TerrainTile(col, row, 'water.jpg', 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)