Merge remote-tracking branch 'origin/MapNew' into EntityCreator

This commit is contained in:
Marcin Kostrzewski 2020-04-05 23:15:28 +02:00
commit c46745f8c0
5 changed files with 28 additions and 27 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -1,20 +1,20 @@
xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx
xwwww..w...w...ww..x xssssssssssssssssssx
xw......w.w...w..w.x xs................sx
xwwww,,,,w,,,,wwww,x xs................sx
xw......w.w...w..w.x xs................sx
xwwww..w...w..w..w.x xs................sx
x..................x xs.....wwwwww.....sx
xw...w...ww...w..wwx xs.....w,,,,w.....sx
xww.ww..w..w..w..w.x xs.....w,,,,w.....sx
xw,w,w,,wwww,,w,,wwx xs.....ww,,ww.....sx
xw...w..w.....w..w.x xs................sx
xw...w..w.....ww.wwx xs................sx
x..................x xs................sx
x.w...w...ww...ww..x xs................sx
x.ww.ww..w..w.w..w.x xs................sx
x,w,w,w,,wwww,wwww,x xs................sx
x.w...w..w..w.w....x xs................sx
x.w...w..w..w.w....x xs................sx
x..................x xssssssssssssssssssx
xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx

View File

@ -1,10 +1,10 @@
import src.entities.Interactable as Interactable
from src.entities import Statistics, Player from src.entities import Statistics, Player
from game.MapNew import Map from src.entities.Interactable import Interactable
class Pickupable(Interactable): class Pickupable(Interactable):
def __init__(self, texture, pos, id, Statistics): def __init__(self, texture, size, pos, Statistics):
super().__init__(texture, pos, id) super().__init__(texture, size, pos)
self.is_pickupable = True self.is_pickupable = True
self.Statistics = Statistics self.Statistics = Statistics
@ -14,4 +14,3 @@ class Pickupable(Interactable):
Player.statistics.set_thirst(self.Statistics.thirst) Player.statistics.set_thirst(self.Statistics.thirst)
Player.statistics.set_hunger(self.Statistics.hunger) Player.statistics.set_hunger(self.Statistics.hunger)
Map.removeSpriteFromMap(self)

View File

@ -60,10 +60,8 @@ class Map:
def terrainDraw(self): def terrainDraw(self):
for row, tiles in enumerate(self.terrain): for row, tiles in enumerate(self.terrain):
for col, tile in enumerate(tiles): for col, tile in enumerate(tiles):
if tile == 'w': if tile == 's':
object = TerrainTile(col, row, 'wall.png', self.tileSize) self.screen.draw(TerrainTile(col, row, 'sand.png', self.tileSize), Locations.MAP, 0, 0)
self.screen.draw(object, Locations.MAP, 0, 0)
self.collidables.add(object)
elif tile == ',': elif tile == ',':
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 == '.':
@ -72,6 +70,10 @@ class Map:
object = TerrainTile(col, row, 'water.jpg', self.tileSize) object = TerrainTile(col, row, 'water.jpg', self.tileSize)
self.screen.draw(object, Locations.MAP, 0, 0) self.screen.draw(object, Locations.MAP, 0, 0)
self.collidables.add(object) 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): def addEntity(self, entity):
self.screen.draw(entity, Locations.MAP, 0, 0) self.screen.draw(entity, Locations.MAP, 0, 0)