add bush and rabbit in mapEntities
This commit is contained in:
parent
05ce54933d
commit
38b6adc8a1
BIN
data/images/entities/bush.jpg
Normal file
BIN
data/images/entities/bush.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB |
BIN
data/images/entities/rabbit.jpg
Normal file
BIN
data/images/entities/rabbit.jpg
Normal file
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 |
@ -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,
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user