New sprites
@ -5,12 +5,13 @@ from mesa.visualization.ModularVisualization import ModularServer
|
|||||||
|
|
||||||
def player_representation(agent):
|
def player_representation(agent):
|
||||||
portrayal = {"Shape": "sprites/hero.png",
|
portrayal = {"Shape": "sprites/hero.png",
|
||||||
"Layer": 1}
|
"Layer": 2}
|
||||||
if agent.isBox:
|
if agent.isBox:
|
||||||
portrayal["Shape"] = "sprites/box.png"
|
portrayal["Shape"] = "sprites/box.png"
|
||||||
portrayal["Layer"] = 0
|
portrayal["Layer"] = 0
|
||||||
elif agent.isCreature:
|
elif agent.isCreature:
|
||||||
portrayal["Shape"]='sprites/creature.png'
|
portrayal["Shape"]='sprites/goblin.png'
|
||||||
|
portrayal["Layer"] = 1
|
||||||
return portrayal
|
return portrayal
|
||||||
|
|
||||||
grid = CanvasGrid(player_representation, 10, 10, 500, 500)
|
grid = CanvasGrid(player_representation, 10, 10, 500, 500)
|
||||||
|
BIN
sprites/bandit.png
Normal file
After Width: | Height: | Size: 197 B |
BIN
sprites/banditChieftain.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
sprites/box.png
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 3.8 KiB |
BIN
sprites/goblin.png
Normal file
After Width: | Height: | Size: 189 B |
BIN
sprites/hero.png
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 208 B |
BIN
sprites/skeleton.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
sprites/skeletonArcher.png
Normal file
After Width: | Height: | Size: 204 B |