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

@@ -1,4 +1,4 @@
import arcade.color
import arcade.color, arcade.key
from arcade.types import Color
from arcade.gui.widgets.buttons import UITextureButtonStyle, UIFlatButtonStyle
from arcade.gui.widgets.slider import UISliderStyle
@@ -8,26 +8,34 @@ log_dir = 'logs'
discord_presence_id = 1424784736726945915
IRS_AGENT_SPAWN_INTERVAL = 1
IRS_AGENT_SPEED = 1
TAX_PER_IRS_AGENT = 200
IRS_AGENT_ATTACK_SPEED = 1
IRS_AGENT_SPEED = 1.5
IRS_AGENT_HEALTH = 15
TAX_PER_IRS_AGENT = 100
TAX_EVASION_LEVELS = {"Compliant Citizen": 0, "Suspicious": 1, "Under Review": 1500, "Flagged": 3500, "Audited": 10000, "Criminal Case": 20000, "Most Wanted": 50000, "Legendary": 100000}
TAX_EVASION_LEVELS = {"Compliant Citizen": 0, "Suspicious": 1, "Under Review": 2500, "Flagged": 5000, "Audited": 10000, "Criminal Case": 20000, "Most Wanted": 50000, "Legendary": 100000}
TAX_EVASION_NAMES = list(TAX_EVASION_LEVELS.keys())
BULLET_SPEED = 5
SPEED_INCREASE_PER_LEVEL = 0.5
SPAWN_INTERVAL_DECREASE_PER_LEVEL = 0.1
TAX_INCREASE_PER_LEVEL = 50
BULLET_SPEED = 10
SPEED_INCREASE_PER_LEVEL = 0.3
SPAWN_INTERVAL_DECREASE_PER_LEVEL = 0.075
HEALTH_INCREASE_PER_LEVEL = 2
TAX_INCREASE_PER_LEVEL = 100
ATTACK_INTERVAL_DECREASE_PER_LEVEL = .1
SHOP_ITEMS = []
PLAYER_SPEED = 4
INVENTORY_ITEMS = [
["Fireball"],
["Lightning Bolt"],
["Ice Blast"],
["Arcane Beam"],
["Fireball", 0.2, 10, 10],
["Lightning Bolt", 0.4, 20, 20],
["Ice Blast", 0.1, 5, 7.5],
["Arcane Beam", 0.2, 20, 15],
]
INVENTORY_TRIGGER_KEYS = [getattr(arcade.key, f"KEY_{n+1}") for n in range(len(INVENTORY_ITEMS))]
button_style = {'normal': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK), 'hover': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK),
'press': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK), 'disabled': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK)}
big_button_style = {'normal': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK, font_size=26), 'hover': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK, font_size=26),

View File

@@ -2,5 +2,17 @@ import arcade.gui, arcade
button_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button.png"))
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button_hovered.png"))
wizard_texture = arcade.texture.make_soft_square_texture(100, arcade.color.BLACK, outer_alpha=255)
irs_agent_texture = arcade.texture.make_soft_square_texture(30, arcade.color.RED, outer_alpha=255)
light_wizard_spritesheet = arcade.load_spritesheet("assets/graphics/mage-light.png").get_texture_grid((48, 64), 3, 12)
light_wizard_up_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in light_wizard_spritesheet[0:2]])
light_wizard_right_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in light_wizard_spritesheet[3:5]])
light_wizard_standing_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in light_wizard_spritesheet[6:8]])
light_wizard_left_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in light_wizard_spritesheet[9:11]])
dark_wizard_spritesheet = arcade.load_spritesheet("assets/graphics/mage-dark.png").get_texture_grid((48, 64), 3, 12)
dark_wizard_up_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in dark_wizard_spritesheet[0:2]])
dark_wizard_right_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in dark_wizard_spritesheet[3:5]])
dark_wizard_standing_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in dark_wizard_spritesheet[6:8]])
dark_wizard_left_animation = arcade.TextureAnimation([arcade.TextureKeyframe(texture, 300) for texture in dark_wizard_spritesheet[9:11]])
irs_agent_texture = arcade.load_texture("assets/graphics/irs_agent.png")