Add unit tests for UnitFactory functionality and initialize units package

This commit is contained in:
2025-08-13 20:36:51 +02:00
parent 088ae02080
commit 689b21bf65
10 changed files with 181 additions and 203 deletions
+2 -2
View File
@@ -32,11 +32,11 @@ class Point(Unit):
def draw(self):
image = self.game.assets[f"BMP_BONUS_{self.value}"]
image_size = self.game.engine.get_image_size(image)
image_size = self.game.render_engine.get_image_size(image)
self.rat_image = image
partial_x, partial_y = 0, 0
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.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit")