Add working inventory, textures, add classes for IRS agents and the Player, add mana, draw UI on top of other things, make shooting automatic in direction of mouse, fix bugs

This commit is contained in:
csd4ni3l
2025-10-10 19:01:31 +02:00
parent bca585bc45
commit aab2ebc513
8 changed files with 150 additions and 60 deletions

View File

@@ -4,16 +4,16 @@ from utils.constants import button_style
class Inventory(arcade.gui.UIBoxLayout):
def __init__(self, items, window_width):
super().__init__(size_hint=(0.75, 0.1), vertical=False, space_between=5)
super().__init__(size_hint=(0.5, 0.1), vertical=False, space_between=5)
self.items = items
self.current_inventory_item = 0
self.inventory_buttons: list[arcade.gui.UITextureButton] = []
for n, item in enumerate(items):
self.inventory_buttons.append(self.add(arcade.gui.UIFlatButton(text=f"{item[0]} ({n + 1})", style=button_style, width=(window_width * 0.75) / len(items) + 1)))
self.inventory_buttons.append(self.add(arcade.gui.UIFlatButton(text=f"{item[0]} ({n + 1})", style=button_style, width=(window_width * 0.5) / len(items) + 1)))
self.pay_tax_button = self.add(arcade.gui.UIFlatButton(text="Pay Tax (1000$)", style=button_style, width=(window_width * 0.75) / len(items) + 1))
self.pay_tax_button = self.add(arcade.gui.UIFlatButton(text="Pay Tax (1000$)", style=button_style, width=(window_width * 0.5) / len(items) + 1))
self.pay_tax_button.style["normal"]["bg"] = arcade.color.GRAY
self.pay_tax_button.style["normal"]["bg"] = arcade.color.GRAY