Entities are living during two ticks, fixes #80
This commit is contained in:
@ -232,14 +232,19 @@ class Explosion(Item):
|
||||
"""
|
||||
When a bomb explodes, the explosion is displayed.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
living_ticks: int
|
||||
|
||||
def __init__(self, living_ticks: int = 2, *args, **kwargs):
|
||||
super().__init__(name="explosion", *args, **kwargs)
|
||||
self.living_ticks = living_ticks
|
||||
|
||||
def act(self, m: Map) -> None:
|
||||
"""
|
||||
The bomb disappears after exploding.
|
||||
"""
|
||||
m.remove_entity(self)
|
||||
self.living_ticks -= 1
|
||||
if self.living_ticks <= 0:
|
||||
m.remove_entity(self)
|
||||
|
||||
def hold(self, player: InventoryHolder) -> None:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user