Merge branch 'MapNew' of https://git.wmi.amu.edu.pl/s444409/DSZI_Survival into MapNew
This commit is contained in:
commit
b2c8333c93
BIN
data/images/terrain/water.jpg
Normal file
BIN
data/images/terrain/water.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
@ -1,20 +1,20 @@
|
|||||||
....................
|
xxxxxxxxxxxxxxxxxxxx
|
||||||
..wwww..w...w...ww..
|
xwwww..w...w...ww..x
|
||||||
..w......w.w...w..w.
|
xw......w.w...w..w.x
|
||||||
,,wwww,,,,w,,,,wwww,
|
xwwww,,,,w,,,,wwww,x
|
||||||
..w......w.w...w..w.
|
xw......w.w...w..w.x
|
||||||
..wwww..w...w..w..w.
|
xwwww..w...w..w..w.x
|
||||||
....................
|
x..................x
|
||||||
.w...w...ww...w..ww.
|
xw...w...ww...w..wwx
|
||||||
.ww.ww..w..w..w..w..
|
xww.ww..w..w..w..w.x
|
||||||
,w,w,w,,wwww,,w,,ww,
|
xw,w,w,,wwww,,w,,wwx
|
||||||
.w...w..w.....w..w..
|
xw...w..w.....w..w.x
|
||||||
.w...w..w.....ww.ww.
|
xw...w..w.....ww.wwx
|
||||||
....................
|
x..................x
|
||||||
..w...w...ww...ww...
|
x.w...w...ww...ww..x
|
||||||
..ww.ww..w..w.w..w..
|
x.ww.ww..w..w.w..w.x
|
||||||
,,w,w,w,,wwww,wwww,,
|
x,w,w,w,,wwww,wwww,x
|
||||||
..w...w..w..w.w.....
|
x.w...w..w..w.w....x
|
||||||
..w...w..w..w.w.....
|
x.w...w..w..w.w....x
|
||||||
....................
|
x..................x
|
||||||
....................
|
xxxxxxxxxxxxxxxxxxxx
|
@ -7,7 +7,7 @@ import pygame
|
|||||||
|
|
||||||
class Player(Entity):
|
class Player(Entity):
|
||||||
def __init__(self, spawnpoint, size):
|
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
|
# Where the player is facing, 0 - north, 1
|
||||||
self.rotation = Rotations.NORTH
|
self.rotation = Rotations.NORTH
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class Game:
|
|||||||
|
|
||||||
self.mapDataFolder = path.dirname("../data/mapdata/")
|
self.mapDataFolder = path.dirname("../data/mapdata/")
|
||||||
self.map = Map(path.join(self.mapDataFolder, 'map.txt'), self.screen)
|
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.map.addEntity(self.player)
|
||||||
self.eventManager = EventManager(self, self.player)
|
self.eventManager = EventManager(self, self.player)
|
||||||
|
|
||||||
|
@ -33,6 +33,10 @@ class Map:
|
|||||||
self.screen.draw(TerrainTile(col, row, 'floor.png', self.tileSize), Locations.MAP, 0, 0)
|
self.screen.draw(TerrainTile(col, row, 'floor.png', self.tileSize), Locations.MAP, 0, 0)
|
||||||
elif tile == '.':
|
elif tile == '.':
|
||||||
self.screen.draw(TerrainTile(col, row, 'grass.png', self.tileSize), Locations.MAP, 0, 0)
|
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):
|
def addEntity(self, entity):
|
||||||
self.screen.draw(entity, Locations.MAP, 0, 0)
|
self.screen.draw(entity, Locations.MAP, 0, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user