add bush and rabbit in mapEntities

This commit is contained in:
Wirus 2020-04-06 00:01:16 +02:00
parent 05ce54933d
commit 38b6adc8a1
7 changed files with 26 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -13,6 +13,7 @@
"hunger" : 20 "hunger" : 20
} }
}, },
{ {
"name" : "cranberry", "name" : "cranberry",
"position" : { "position" : {
@ -26,5 +27,29 @@
"thirst" : 2, "thirst" : 2,
"hunger" : 10 "hunger" : 10
} }
},
{
"name" : "rabbit",
"position" : {
"x": 12,
"y": 16
},
"isPickupable" : true,
"effect" : {
"hp": 30,
"stamina": -5,
"thirst": -5,
"hunger": 40
}
},
{
"name" : "bush",
"position" : {
"x": 15,
"y": 9
},
"isPickupable" : false,
} }
] ]

View File

@ -8,6 +8,7 @@ class Entity(pygame.sprite.Sprite):
def __init__(self, texture, size, pos): def __init__(self, texture, size, pos):
super().__init__() super().__init__()
self.image, self.rect = self.getTexture(texture, size) self.image, self.rect = self.getTexture(texture, size)
self.image.set_colorkey((255, 255, 255))
self.rect.x = pos[0] self.rect.x = pos[0]
self.rect.y = pos[1] self.rect.y = pos[1]
self.id = self.getId() self.id = self.getId()