Final 2.0

This commit is contained in:
Matteo Benedetto
2025-08-20 16:43:16 +02:00
parent 0141063baa
commit 17e5abc7df
8 changed files with 112 additions and 11 deletions
+3 -3
View File
@@ -266,7 +266,7 @@ class GameWindow:
def update_ammo(self, ammo, assets):
"""Update and display the ammo count"""
ammo_text = f"{ammo['bomb']['count']}/{ammo['bomb']['max']} {ammo['mine']['count']}/{ammo['mine']['max']} {ammo['nuclear']['count']}/{ammo['nuclear']['max']} "
ammo_text = f"{ammo['bomb']['count']}/{ammo['bomb']['max']} {ammo['mine']['count']}/{ammo['mine']['max']} {ammo['gas']['count']}/{ammo['gas']['max']} "
if self.ammo_text != ammo_text:
self.ammo_text = ammo_text
font = self.fonts[20]
@@ -279,8 +279,8 @@ class GameWindow:
self.renderer.copy(self.ammo_background, dstrect=sdl2.SDL_Rect(position[0] - 5, position[1] - 2, text_width + 10, text_height + 4))
self.renderer.copy(self.ammo_sprite, dstrect=sdl2.SDL_Rect(position[0], position[1], text_width, text_height))
self.renderer.copy(assets["BMP_BOMB0"], dstrect=sdl2.SDL_Rect(position[0]+25, position[1], 20, 20))
self.renderer.copy(assets["BMP_POISON"], dstrect=sdl2.SDL_Rect(position[0]+80, position[1], 20, 20))
self.renderer.copy(assets["BMP_NUCLEAR"], dstrect=sdl2.SDL_Rect(position[0]+130, position[1], 20, 20))
self.renderer.copy(assets["BMP_POISON"], dstrect=sdl2.SDL_Rect(position[0]+85, position[1], 20, 20))
self.renderer.copy(assets["BMP_GAS"], dstrect=sdl2.SDL_Rect(position[0]+140, position[1], 20, 20))
# ======================
# VIEW & NAVIGATION
# ======================