Aggiungi file di configurazione per i binding dei tasti e implementa la gestione degli input nel gioco
This commit is contained in:
+2
-1
@@ -103,7 +103,9 @@ class Rat(Unit):
|
||||
self.game.spawn_unit(Point, unit.position_before, value=score)
|
||||
|
||||
def draw(self):
|
||||
start_perf = self.game.engine.get_perf_counter()
|
||||
direction = self.calculate_rat_direction()
|
||||
|
||||
sex = self.sex if self.age > AGE_THRESHOLD else "BABY"
|
||||
image = self.game.rat_assets[sex][direction]
|
||||
image_size = self.game.engine.get_image_size(image)
|
||||
@@ -117,7 +119,6 @@ class Rat(Unit):
|
||||
|
||||
x_pos = self.position_before[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2 + partial_x
|
||||
y_pos = self.position_before[1] * self.game.cell_size + (self.game.cell_size - image_size[1]) // 2 + partial_y
|
||||
|
||||
self.game.engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit")
|
||||
self.bbox = (x_pos, y_pos, x_pos + image_size[0], y_pos + image_size[1])
|
||||
#self.game.engine.draw_rectangle(self.bbox[0], self.bbox[1], self.bbox[2] - self.bbox[0], self.bbox[3] - self.bbox[1], "unit")
|
||||
|
||||
Reference in New Issue
Block a user