Aggiungi gestione dei controlli da tastiera e migliora la logica di spawn delle unità
This commit is contained in:
Binary file not shown.
+1
-4
@@ -37,7 +37,6 @@ class Bomb(Unit):
|
||||
n= 3 -n +1
|
||||
if n < 0:
|
||||
n = 0
|
||||
print(self.age)
|
||||
image = self.game.bomb_assets[n]
|
||||
image_size = self.game.engine.get_image_size(image)
|
||||
self.rat_image = image
|
||||
@@ -69,13 +68,11 @@ class Timer(Bomb):
|
||||
for victim in self.game.unit_positions.get((x, y), []):
|
||||
if victim.id in self.game.units:
|
||||
if victim.partial_move >= 0.5:
|
||||
victim.die()
|
||||
self.game.spawn_unit(Point, (x, y), value=10)
|
||||
victim.die()
|
||||
for victim in self.game.unit_positions_before.get((x, y), []):
|
||||
if victim.id in self.game.units:
|
||||
if victim.partial_move < 0.5:
|
||||
victim.die()
|
||||
self.game.spawn_unit(Point, (x, y), value=10)
|
||||
else:
|
||||
break
|
||||
if direction == "N":
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from .unit import Unit
|
||||
from .points import Point
|
||||
|
||||
import random
|
||||
import uuid
|
||||
@@ -99,6 +100,7 @@ class Rat(Unit):
|
||||
if not unit:
|
||||
unit = self
|
||||
self.game.units.pop(unit.id)
|
||||
self.game.spawn_unit(Point, unit.position_before)
|
||||
|
||||
def draw(self):
|
||||
direction = self.calculate_rat_direction()
|
||||
|
||||
Reference in New Issue
Block a user