diff --git a/assets/textures/Generic/Vector/generic_button_circle_fill.svg.import b/assets/textures/Generic/Vector/generic_button_circle_fill.svg.import index 5049426..3a71047 100644 --- a/assets/textures/Generic/Vector/generic_button_circle_fill.svg.import +++ b/assets/textures/Generic/Vector/generic_button_circle_fill.svg.import @@ -32,6 +32,6 @@ process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 detect_3d/compress_to=1 -svg/scale=1.0 +svg/scale=2.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/assets/textures/Xbox Series/Vector/xbox_button_a.svg.import b/assets/textures/Xbox Series/Vector/xbox_button_a.svg.import index fe2c4aa..c41de0e 100644 --- a/assets/textures/Xbox Series/Vector/xbox_button_a.svg.import +++ b/assets/textures/Xbox Series/Vector/xbox_button_a.svg.import @@ -32,6 +32,6 @@ process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 detect_3d/compress_to=1 -svg/scale=1.0 +svg/scale=3.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg.import b/assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg.import index ea986dc..086772d 100644 --- a/assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg.import +++ b/assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg.import @@ -32,6 +32,6 @@ process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 detect_3d/compress_to=1 -svg/scale=1.0 +svg/scale=3.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/assets/textures/Xbox Series/Vector/xbox_button_x_outline.svg.import b/assets/textures/Xbox Series/Vector/xbox_button_x_outline.svg.import index ea66830..20faa6f 100644 --- a/assets/textures/Xbox Series/Vector/xbox_button_x_outline.svg.import +++ b/assets/textures/Xbox Series/Vector/xbox_button_x_outline.svg.import @@ -32,6 +32,6 @@ process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 detect_3d/compress_to=1 -svg/scale=1.0 +svg/scale=3.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/entities/monster/monster.gd b/entities/monster/monster.gd index 650b694..399f959 100644 --- a/entities/monster/monster.gd +++ b/entities/monster/monster.gd @@ -1,8 +1,6 @@ class_name Monster extends CharacterBody3D -signal level_up - @export var data: MonsterData = MonsterData.new() var spawn_point: Vector3 = Vector3(0, 0, 0) @@ -28,8 +26,9 @@ func _physics_process(delta: float) -> void: time += delta var x_movement = sin(time * frequency) * amplitude + var y_movement = sin(time * 25) * 4.0 var z_movement = cos(time * frequency) * amplitude - velocity = Vector3(x_movement, 0, z_movement) + velocity = Vector3(x_movement, y_movement, z_movement) # if move_and_slide reports collisions if move_and_slide(): diff --git a/entities/player/player.gd b/entities/player/player.gd index b3c9765..412fb85 100644 --- a/entities/player/player.gd +++ b/entities/player/player.gd @@ -81,9 +81,13 @@ func start_battle(enemy: Node3D, player_position: Vector3) -> void: in_battle = true velocity = Vector3.ZERO animated_mesh.idle() + UI.show_battle_ui(true) + UI.show_ingame_controls(false) + + await get_tree().create_timer(2.0).timeout - print("timer over") + print("Battle over") in_battle = false func save() -> Dictionary: diff --git a/game.tscn b/game.tscn index 38f5e18..4c9ed92 100644 --- a/game.tscn +++ b/game.tscn @@ -1,14 +1,10 @@ -[gd_scene load_steps=4 format=3 uid="uid://cswuap81n7t3f"] +[gd_scene load_steps=3 format=3 uid="uid://cswuap81n7t3f"] [ext_resource type="Script" path="res://game.gd" id="1_mfbtr"] [ext_resource type="PackedScene" uid="uid://bhhqaysqjw2d" path="res://worlds/world1/world1.tscn" id="2_knpqt"] -[ext_resource type="PackedScene" uid="uid://b5y7pdfe6ougf" path="res://ui/ui.tscn" id="2_ynhuf"] [node name="Game" type="Node3D"] script = ExtResource("1_mfbtr") starting_world = ExtResource("2_knpqt") -[node name="UI" parent="." instance=ExtResource("2_ynhuf")] - [node name="CurrentScene" type="Node3D" parent="."] -unique_name_in_owner = true diff --git a/globals/Utils.gd b/globals/Utils.gd new file mode 100644 index 0000000..7e7e727 --- /dev/null +++ b/globals/Utils.gd @@ -0,0 +1,16 @@ +extends Node + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +func load_base_monster_data(p_unique_id) -> MonsterData: + var path = "res://resources/monsters/" + p_unique_id + ".tres" + if ResourceLoader.exists(path): + var base_monster = load(path) + return base_monster + else: + printerr("Monster.gd: No monster with the ID %s found" % p_unique_id) + return null diff --git a/globals/audio_manager.gd b/globals/audio_manager.gd new file mode 100644 index 0000000..2eab999 --- /dev/null +++ b/globals/audio_manager.gd @@ -0,0 +1,18 @@ +extends Node + +@export var music: Array + +func play(): + pass + +func stop_all(): + pass + +func fade_out(): + pass + +func fade_in(): + pass + +func battle(): + pass diff --git a/project.godot b/project.godot index a12489b..6250d24 100644 --- a/project.godot +++ b/project.godot @@ -18,9 +18,11 @@ config/icon="res://assets/logo/logo.png" [autoload] +Utils="*res://globals/Utils.gd" SaveManager="*res://resources/save_game/save_manager.gd" -UI="*res://ui/ui.gd" SceneManager="*res://globals/scene_manager.gd" +AudioManager="*res://globals/audio_manager.gd" +UI="*res://ui/ui.tscn" [display] @@ -35,8 +37,6 @@ window/handheld/orientation=1 folder_colors={ "res://assets/": "red", "res://entities/": "blue", -"res://globals/": "purple", -"res://materials/": "pink", "res://resources/": "yellow", "res://ui/": "green" } @@ -48,22 +48,22 @@ save_nodes="" [input] joystick_right_right={ -"deadzone": 0.5, +"deadzone": 0.0, "events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null) ] } joystick_right_left={ -"deadzone": 0.5, +"deadzone": 0.0, "events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null) ] } joystick_right_up={ -"deadzone": 0.5, +"deadzone": 0.0, "events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null) ] } joystick_right_down={ -"deadzone": 0.5, +"deadzone": 0.0, "events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) ] } diff --git a/resources/monster_data.gd b/resources/monster_data.gd index ffb5905..3923fc2 100644 --- a/resources/monster_data.gd +++ b/resources/monster_data.gd @@ -1,10 +1,10 @@ class_name MonsterData extends Resource -@export var unique_id : String = "" +signal on_level_up -@export var display_name : String = "" -@export var nickname: String = "" +@export var unique_id : String = "" +@export var name : String = "" @export var description: String = "" @export var thumbnail: CompressedTexture2D = preload("res://assets/logo/logo.png") @export var model: PackedScene @@ -16,16 +16,18 @@ extends Resource @export var base_health: int = 1 @export var base_defense: int = 1 @export var base_tempo: int = 1 -@export var base_xp_for_next_level: int = 1 +@export var base_xp: int = 1 # Current Values -var attack: int = 1 -var current_health: int = 1 -var health: int = 1 -var defense: int = 1 -var tempo: int = 1 -var level: int = 1 -var xp: int = 1 +@export var attack: int = 1 +@export var current_health: int = 1 +@export var health: int = 1 +@export var defense: int = 1 +@export var tempo: int = 1 +@export var level: int = 1 +@export var xp: int = 1 +@export var nickname: String = "" +@export var xp_for_levelup: int = 1 # The ID is the filename of the monster from res://entities/monsters/.tres @@ -34,34 +36,70 @@ func set_data(p_unique_id = "", current_values: Dictionary = {}, p_level: int = printerr("Monster.gd: No ID given") return - # Get an instance of the base monster data form the MonsterDatabase - var base_monster = load_base_monster_data(p_unique_id) + # Get an instance of the base monster data + var base_monster = Utils.load_base_monster_data(p_unique_id) - # set all the values here - self.display_name = base_monster.display_name + # Set the values + self.name = base_monster.name self.description = base_monster.description self.thumbnail = base_monster.thumbnail self.model = base_monster.model self.primary_type = base_monster.primary_type self.secondary_type = base_monster.secondary_type + + # Set base values self.base_attack = base_monster.base_attack self.base_health = base_monster.base_health self.base_defense = base_monster.base_defense self.base_tempo = base_monster.base_tempo - self.base_xp_for_next_level = base_monster.base_xp_for_next_level - self.level = p_level + self.base_xp = base_monster.base_xp - # process custom and current values + set_level(p_level) + + # If there are not values to edit, return if current_values.is_empty(): return - - if current_values.has("nickname"): - self.nickname = current_values.nickname + + # else, set custom values here + # TODO -func load_base_monster_data(p_unique_id): - var path = "res://resources/monsters/" + p_unique_id + ".tres" - if ResourceLoader.exists(path): - var base_monster = load(path) - return base_monster +## This sets the monster to the specified level +func set_level(p_level: int) -> void: + self.level = p_level + update() + +# Updates the values according to the current level of the monster +func update() -> void: + self.attack = int((((base_attack * 2) * level ) / 100) + (level + 5)) + self.health = int((((base_health * 2) * level ) / 100) + (level + 5)) + self.defense = int((((base_defense * 2) * level ) / 100) + (level + 5)) + self.tempo = int((((base_tempo * 2) * level ) / 100) + (level + 5)) + self.xp_for_levelup = int(pow(level + 1, 3)) + +func level_up() -> void: + set_level(level + 1) + emit_signal("on_level_up") + +func calculate_gained_xp(enemy_data: MonsterData) -> int: + var calculated_xp: int = 0 + calculated_xp = int( (enemy_data.base_xp * enemy_data.level / 5) * ( float(enemy_data.level) / float(level) ) ) + return calculated_xp + +func add_xp(amount: int = 0) -> void: + xp += amount + if(xp >= xp_for_levelup): + level_up() + +func attack_enemy(enemy_data: MonsterData) -> int: + var damage: int = 0 + var base_damage: int = 2 - printerr("Monster.gd: No monster with the ID %s found" % p_unique_id) + damage = floor(floor((level * 2/5 + 2)) * base_damage * (float(attack) / (2 * enemy_data.defense)) + 2) + + return damage + +func take_damage(amount: int) -> void: + current_health = max(current_health - amount, 0) + +func heal(amount: int) -> void: + current_health = min(current_health + amount, health) diff --git a/resources/monsters/debuggy.tres b/resources/monsters/debuggy.tres index 61fba18..9b51873 100644 --- a/resources/monsters/debuggy.tres +++ b/resources/monsters/debuggy.tres @@ -7,8 +7,7 @@ [resource] script = ExtResource("1_2n3ph") unique_id = "debuggy" -display_name = "Debuggy" -nickname = "Debuggy" +name = "Debuggy" description = "A debug monster" thumbnail = ExtResource("2_a4t2w") model = ExtResource("1_dsg0f") @@ -18,4 +17,13 @@ base_attack = 10 base_health = 20 base_defense = 30 base_tempo = 40 -base_xp_for_next_level = 50 +base_xp = 3 +attack = 1 +current_health = 1 +health = 1 +defense = 1 +tempo = 1 +level = 1 +xp = 1 +nickname = "" +xp_for_levelup = 1 diff --git a/ui/battle_ui/battle_move_button.tscn b/ui/battle_ui/battle_move_button.tscn new file mode 100644 index 0000000..a48afd9 --- /dev/null +++ b/ui/battle_ui/battle_move_button.tscn @@ -0,0 +1,52 @@ +[gd_scene load_steps=4 format=3 uid="uid://vxwg04fxtbxf"] + +[ext_resource type="Texture2D" uid="uid://d1324yxmpvk8e" path="res://assets/textures/Game Icons/Vector/2x/wrench.png" id="1_2tmqf"] +[ext_resource type="Texture2D" uid="uid://ofkfd2bydpph" path="res://assets/textures/Generic/Vector/generic_button_circle_outline.svg" id="2_88fpt"] + +[sub_resource type="LabelSettings" id="LabelSettings_ps1u1"] +font_size = 24 + +[node name="Move1" type="PanelContainer"] +offset_right = 236.0 +offset_bottom = 73.0 + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 2 +theme_override_constants/margin_left = 6 +theme_override_constants/margin_top = 6 +theme_override_constants/margin_right = 6 +theme_override_constants/margin_bottom = 6 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer"] +layout_mode = 2 +texture = ExtResource("1_2tmqf") +expand_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="MoveName" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer"] +layout_mode = 2 +text = "Move Name 1" +label_settings = SubResource("LabelSettings_ps1u1") + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +texture = ExtResource("2_88fpt") +expand_mode = 2 + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "Effective" + +[node name="Label2" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 10 +text = "10 / 10" diff --git a/ui/battle_ui/battle_ui.gd b/ui/battle_ui/battle_ui.gd new file mode 100644 index 0000000..187ffe6 --- /dev/null +++ b/ui/battle_ui/battle_ui.gd @@ -0,0 +1,18 @@ +extends Control + +var move_button = preload("res://ui/battle_ui/battle_move_button.tscn") + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + self.visible = false + for i in range(4): + var button = move_button.instantiate() + $MarginContainer/HBoxContainer/BattleMovesMenu.add_child(button) + + +func _on_battle_button_pressed() -> void: + print("attack here") + # attack here + #%MainBattleMenu.visible = false + #%BattleMovesMenu.visible = true + pass # Replace with function body. diff --git a/ui/battle_ui/battle_ui.tscn b/ui/battle_ui/battle_ui.tscn new file mode 100644 index 0000000..579dd28 --- /dev/null +++ b/ui/battle_ui/battle_ui.tscn @@ -0,0 +1,281 @@ +[gd_scene load_steps=19 format=3 uid="uid://dyroahq85mhws"] + +[ext_resource type="Script" path="res://ui/battle_ui/battle_ui.gd" id="1_jyqir"] +[ext_resource type="Texture2D" uid="uid://ve2k0qrfpwxw" path="res://assets/textures/Generic/Vector/generic_button_circle_fill.svg" id="2_keyyt"] +[ext_resource type="Texture2D" uid="uid://4t8cotroofge" path="res://assets/textures/Game Icons/Vector/2x/upRight.png" id="3_fa6tk"] +[ext_resource type="StyleBox" uid="uid://ddtjhp2lob6to" path="res://ui/styles/battle_ui_normal_button.tres" id="4_r2q1k"] +[ext_resource type="Texture2D" uid="uid://cxry7h4q17lir" path="res://assets/textures/Game Icons/Vector/2x/star.png" id="4_saqy8"] +[ext_resource type="Texture2D" uid="uid://c1dlsfah0ioi5" path="res://assets/textures/Game Icons/Vector/2x/massiveMultiplayer.png" id="5_pnobx"] +[ext_resource type="StyleBox" uid="uid://cv8ispcxuwjn5" path="res://ui/styles/battle_ui_pressed_button.tres" id="5_w48y1"] +[ext_resource type="Texture2D" uid="uid://dbycrn4i3wkhu" path="res://assets/textures/Game Icons/Vector/2x/menuList.png" id="6_ikm1n"] +[ext_resource type="Texture2D" uid="uid://cs84avwwjbn5q" path="res://assets/textures/Game Icons/Vector/2x/exitRight.png" id="7_tihhr"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6o8cs"] +content_margin_left = 20.0 +content_margin_top = 2.0 +content_margin_right = 20.0 +content_margin_bottom = 2.0 +bg_color = Color(0, 0, 0, 0.501961) +corner_radius_top_left = 12 +corner_radius_top_right = 12 +corner_radius_bottom_right = 12 +corner_radius_bottom_left = 12 + +[sub_resource type="LabelSettings" id="LabelSettings_38ujs"] +font_size = 26 + +[sub_resource type="LabelSettings" id="LabelSettings_kcdfy"] +font_size = 26 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_auqmk"] +content_margin_top = 10.0 +content_margin_right = 10.0 +bg_color = Color(0, 0, 0, 0.392157) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(1, 1, 1, 1) +corner_radius_top_left = 4 +corner_radius_top_right = 4 +corner_radius_bottom_right = 4 +corner_radius_bottom_left = 4 +expand_margin_left = 3.0 +expand_margin_top = 3.0 +expand_margin_right = 3.0 +expand_margin_bottom = 3.0 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_84eln"] +bg_color = Color(0, 0.712615, 0.446827, 1) +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +expand_margin_left = 1.0 +expand_margin_top = 1.0 +expand_margin_right = 1.0 +expand_margin_bottom = 1.0 + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_eqgks"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4ki2k"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cabkl"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_g6kqv"] + +[node name="BattleUI" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +script = ExtResource("1_jyqir") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -138.0 +grow_horizontal = 2 +grow_vertical = 0 +theme_override_constants/margin_left = 30 +theme_override_constants/margin_right = 30 +theme_override_constants/margin_bottom = 50 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="Left" type="HBoxContainer" parent="MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_vertical = 8 +theme_override_constants/separation = 16 + +[node name="PartyAliveStatus" type="VBoxContainer" parent="MarginContainer/HBoxContainer/Left"] +layout_mode = 2 + +[node name="Monster1" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_keyyt") +expand_mode = 2 + +[node name="Monster2" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"] +self_modulate = Color(1, 1, 1, 0.392157) +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_keyyt") +expand_mode = 2 + +[node name="Monster3" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"] +self_modulate = Color(1, 1, 1, 0.392157) +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_keyyt") +expand_mode = 2 + +[node name="Monster4" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"] +self_modulate = Color(1, 1, 1, 0.392157) +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_keyyt") +expand_mode = 2 + +[node name="Monster5" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"] +self_modulate = Color(1, 1, 1, 0.392157) +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_keyyt") +expand_mode = 2 + +[node name="Monster6" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"] +self_modulate = Color(1, 1, 1, 0.392157) +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +size_flags_horizontal = 0 +texture = ExtResource("2_keyyt") +expand_mode = 2 + +[node name="PartyFighterInfo" type="VBoxContainer" parent="MarginContainer/HBoxContainer/Left"] +layout_mode = 2 +size_flags_vertical = 0 +theme_override_constants/separation = 10 + +[node name="LevelAndGender" type="HBoxContainer" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo"] +layout_mode = 2 + +[node name="Level" type="PanelContainer" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo/LevelAndGender"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_6o8cs") + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo/LevelAndGender/Level"] +layout_mode = 2 +text = "Lv. 99" +label_settings = SubResource("LabelSettings_38ujs") + +[node name="Gender" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo/LevelAndGender"] +self_modulate = Color(0.450091, 0.470517, 0.93375, 1) +custom_minimum_size = Vector2(12, 12) +layout_mode = 2 +texture = ExtResource("3_fa6tk") +expand_mode = 2 +stretch_mode = 4 + +[node name="MonsterName" type="Label" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo"] +layout_mode = 2 +text = "Monstername" +label_settings = SubResource("LabelSettings_kcdfy") + +[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo"] +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_auqmk") +theme_override_styles/fill = SubResource("StyleBoxFlat_84eln") +value = 50.0 +show_percentage = false + +[node name="Spacer" type="Control" parent="MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.5 + +[node name="MainBattleMenu" type="VBoxContainer" parent="MarginContainer/HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="BattleButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"] +layout_mode = 2 +theme_override_constants/h_separation = 18 +theme_override_constants/icon_max_width = 20 +theme_override_font_sizes/font_size = 26 +theme_override_styles/focus = SubResource("StyleBoxEmpty_eqgks") +theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k") +theme_override_styles/disabled = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed = ExtResource("4_r2q1k") +theme_override_styles/hover_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover = ExtResource("4_r2q1k") +theme_override_styles/pressed_mirrored = ExtResource("5_w48y1") +theme_override_styles/pressed = ExtResource("5_w48y1") +theme_override_styles/normal_mirrored = ExtResource("4_r2q1k") +theme_override_styles/normal = ExtResource("4_r2q1k") +text = "Battle" +icon = ExtResource("4_saqy8") +alignment = 0 + +[node name="PartyButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"] +layout_mode = 2 +theme_override_constants/h_separation = 18 +theme_override_constants/icon_max_width = 20 +theme_override_font_sizes/font_size = 26 +theme_override_styles/focus = SubResource("StyleBoxEmpty_4ki2k") +theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k") +theme_override_styles/disabled = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed = ExtResource("4_r2q1k") +theme_override_styles/hover_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover = ExtResource("4_r2q1k") +theme_override_styles/pressed_mirrored = ExtResource("5_w48y1") +theme_override_styles/pressed = ExtResource("5_w48y1") +theme_override_styles/normal_mirrored = ExtResource("4_r2q1k") +theme_override_styles/normal = ExtResource("4_r2q1k") +text = "Party" +icon = ExtResource("5_pnobx") +alignment = 0 + +[node name="ItemsButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"] +layout_mode = 2 +theme_override_constants/h_separation = 18 +theme_override_constants/icon_max_width = 20 +theme_override_font_sizes/font_size = 26 +theme_override_styles/focus = SubResource("StyleBoxEmpty_cabkl") +theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k") +theme_override_styles/disabled = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed = ExtResource("4_r2q1k") +theme_override_styles/hover_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover = ExtResource("4_r2q1k") +theme_override_styles/pressed_mirrored = ExtResource("5_w48y1") +theme_override_styles/pressed = ExtResource("5_w48y1") +theme_override_styles/normal_mirrored = ExtResource("4_r2q1k") +theme_override_styles/normal = ExtResource("4_r2q1k") +text = "Items" +icon = ExtResource("6_ikm1n") +alignment = 0 + +[node name="RunButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"] +layout_mode = 2 +theme_override_constants/h_separation = 18 +theme_override_constants/icon_max_width = 20 +theme_override_font_sizes/font_size = 26 +theme_override_styles/focus = SubResource("StyleBoxEmpty_g6kqv") +theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k") +theme_override_styles/disabled = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover_pressed = ExtResource("4_r2q1k") +theme_override_styles/hover_mirrored = ExtResource("4_r2q1k") +theme_override_styles/hover = ExtResource("4_r2q1k") +theme_override_styles/pressed_mirrored = ExtResource("5_w48y1") +theme_override_styles/pressed = ExtResource("5_w48y1") +theme_override_styles/normal_mirrored = ExtResource("4_r2q1k") +theme_override_styles/normal = ExtResource("4_r2q1k") +text = "Run" +icon = ExtResource("7_tihhr") +alignment = 0 + +[node name="BattleMovesMenu" type="VBoxContainer" parent="MarginContainer/HBoxContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +size_flags_horizontal = 3 + +[connection signal="pressed" from="MarginContainer/HBoxContainer/MainBattleMenu/BattleButton" to="." method="_on_battle_button_pressed"] diff --git a/ui/camera_controls.gd b/ui/ingame_controls/camera_controls.gd similarity index 66% rename from ui/camera_controls.gd rename to ui/ingame_controls/camera_controls.gd index a3761f4..7c35e52 100644 --- a/ui/camera_controls.gd +++ b/ui/ingame_controls/camera_controls.gd @@ -2,7 +2,15 @@ extends Control var pressed: bool = false var previous_position : Vector2 = Vector2.ZERO -var speed : float = 0.04 +var speed : float = 0.5 +var delta_position: Vector2 = Vector2.ZERO +var damping_factor: float = 0.08 + +func _process(delta: float) -> void: + simulate_joystick_motion(JOY_AXIS_RIGHT_X, delta_position.x * delta * speed, 0) + print(delta_position) + #delta_position *= 0.92 + delta_position *= (1 - damping_factor) func _gui_input(event: InputEvent) -> void: # Filter touch or drag events only. @@ -11,16 +19,15 @@ func _gui_input(event: InputEvent) -> void: if event is InputEventScreenTouch: if event.is_pressed(): + previous_position = event.position pressed = true else: pressed = false simulate_joystick_motion(JOY_AXIS_RIGHT_X, 0, 0) + previous_position = Vector2.ZERO if pressed and event is InputEventScreenDrag: - var delta_position : Vector2 = event.position - previous_position - #print(delta_position) - simulate_joystick_motion(JOY_AXIS_RIGHT_X, -delta_position.x * speed, 0) - #simulate_joystick_motion(JOY_AXIS_RIGHT_Y, delta_position.y * speed, 0) + delta_position = clamp(previous_position - event.position, Vector2(-10, -10), Vector2(10, 10)) # finally update the previous position previous_position = event.position diff --git a/ui/ingame_controls.gd b/ui/ingame_controls/ingame_controls.gd similarity index 98% rename from ui/ingame_controls.gd rename to ui/ingame_controls/ingame_controls.gd index 3d21595..6586f16 100644 --- a/ui/ingame_controls.gd +++ b/ui/ingame_controls/ingame_controls.gd @@ -1,4 +1,4 @@ -extends MarginContainer +extends Control class_name IngameControls signal menu_button_clicked diff --git a/ui/ingame_controls.tscn b/ui/ingame_controls/ingame_controls.tscn similarity index 58% rename from ui/ingame_controls.tscn rename to ui/ingame_controls/ingame_controls.tscn index ec1e4fd..ad10594 100644 --- a/ui/ingame_controls.tscn +++ b/ui/ingame_controls/ingame_controls.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=11 format=3 uid="uid://1anjhvi173g3"] -[ext_resource type="Script" path="res://ui/ingame_controls.gd" id="1_iw1sp"] +[ext_resource type="Script" path="res://ui/ingame_controls/ingame_controls.gd" id="1_iw1sp"] [ext_resource type="Texture2D" uid="uid://2vxx2waofxpw" path="res://assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg" id="1_wr5sh"] -[ext_resource type="Script" path="res://ui/joystick.gd" id="2_pyri2"] +[ext_resource type="Script" path="res://ui/ingame_controls/joystick.gd" id="2_pyri2"] [ext_resource type="Texture2D" uid="uid://8anyvhkcy4ng" path="res://assets/textures/Xbox Series/Vector/xbox_button_a.svg" id="3_lgi8v"] [ext_resource type="Texture2D" uid="uid://cbep021ykpb23" path="res://assets/textures/Game Icons/Vector/2x/save.png" id="5_2pil1"] [ext_resource type="Texture2D" uid="uid://bwyoxxotdisyp" path="res://assets/textures/Game Icons/Vector/2x/gear.png" id="5_nwwsc"] @@ -15,12 +15,26 @@ corner_radius_top_left = 999 corner_radius_top_right = 999 corner_radius_bottom_right = 999 corner_radius_bottom_left = 999 +corner_detail = 12 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hfsbq"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x4icw"] -[node name="IngameControls" type="MarginContainer"] +[node name="IngameControls" type="Control"] +layout_mode = 3 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_iw1sp") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 anchors_preset = 12 anchor_top = 1.0 anchor_right = 1.0 @@ -28,25 +42,23 @@ anchor_bottom = 1.0 offset_top = -338.0 grow_horizontal = 2 grow_vertical = 0 -size_flags_vertical = 8 theme_override_constants/margin_left = 30 theme_override_constants/margin_right = 30 theme_override_constants/margin_bottom = 30 -script = ExtResource("1_iw1sp") -[node name="HBoxContainer" type="HBoxContainer" parent="."] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] layout_mode = 2 size_flags_vertical = 8 alignment = 2 -[node name="Left" type="VBoxContainer" parent="HBoxContainer"] +[node name="Left" type="VBoxContainer" parent="MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 8 alignment = 2 -[node name="MenuButton" type="Button" parent="HBoxContainer/Left"] +[node name="MenuButton" type="Button" parent="MarginContainer/HBoxContainer/Left"] self_modulate = Color(0, 0, 0, 0.392157) custom_minimum_size = Vector2(120, 120) layout_mode = 2 @@ -56,14 +68,14 @@ icon = ExtResource("1_wr5sh") flat = true expand_icon = true -[node name="JoystickPanel" type="Panel" parent="HBoxContainer/Left"] +[node name="JoystickPanel" type="Panel" parent="MarginContainer/HBoxContainer/Left"] custom_minimum_size = Vector2(180, 180) layout_mode = 2 size_flags_horizontal = 0 theme_override_styles/panel = SubResource("StyleBoxFlat_nfkty") script = ExtResource("2_pyri2") -[node name="Thumbstick" type="TextureRect" parent="HBoxContainer/Left/JoystickPanel"] +[node name="Thumbstick" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/JoystickPanel"] self_modulate = Color(0, 0, 0, 0.392157) layout_mode = 1 anchors_preset = 8 @@ -81,13 +93,13 @@ texture = ExtResource("3_lgi8v") expand_mode = 3 stretch_mode = 5 -[node name="Right" type="VBoxContainer" parent="HBoxContainer"] +[node name="Right" type="VBoxContainer" parent="MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_vertical = 8 theme_override_constants/separation = 0 alignment = 2 -[node name="SaveButton" type="Button" parent="HBoxContainer/Right"] +[node name="SaveButton" type="Button" parent="MarginContainer/HBoxContainer/Right"] unique_name_in_owner = true self_modulate = Color(0, 0, 0, 0.392157) custom_minimum_size = Vector2(120, 120) @@ -98,7 +110,7 @@ flat = true icon_alignment = 1 expand_icon = true -[node name="SettingsButton" type="Button" parent="HBoxContainer/Right"] +[node name="SettingsButton" type="Button" parent="MarginContainer/HBoxContainer/Right"] self_modulate = Color(0, 0, 0, 0.392157) custom_minimum_size = Vector2(120, 120) layout_mode = 2 @@ -108,9 +120,9 @@ flat = true icon_alignment = 1 expand_icon = true -[connection signal="pressed" from="HBoxContainer/Left/MenuButton" to="." method="_on_menu_button_pressed"] -[connection signal="gui_input" from="HBoxContainer/Left/JoystickPanel" to="HBoxContainer/Left/JoystickPanel" method="_on_gui_input"] -[connection signal="resized" from="HBoxContainer/Left/JoystickPanel" to="HBoxContainer/Left/JoystickPanel" method="_on_resized"] -[connection signal="button_down" from="HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_down"] -[connection signal="button_up" from="HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_up"] -[connection signal="pressed" from="HBoxContainer/Right/SettingsButton" to="." method="_on_settings_button_pressed"] +[connection signal="pressed" from="MarginContainer/HBoxContainer/Left/MenuButton" to="." method="_on_menu_button_pressed"] +[connection signal="gui_input" from="MarginContainer/HBoxContainer/Left/JoystickPanel" to="MarginContainer/HBoxContainer/Left/JoystickPanel" method="_on_gui_input"] +[connection signal="resized" from="MarginContainer/HBoxContainer/Left/JoystickPanel" to="MarginContainer/HBoxContainer/Left/JoystickPanel" method="_on_resized"] +[connection signal="button_down" from="MarginContainer/HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_down"] +[connection signal="button_up" from="MarginContainer/HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_up"] +[connection signal="pressed" from="MarginContainer/HBoxContainer/Right/SettingsButton" to="." method="_on_settings_button_pressed"] diff --git a/ui/joystick.gd b/ui/ingame_controls/joystick.gd similarity index 100% rename from ui/joystick.gd rename to ui/ingame_controls/joystick.gd diff --git a/ui/ingame_menu.gd b/ui/ingame_menu/ingame_menu.gd similarity index 86% rename from ui/ingame_menu.gd rename to ui/ingame_menu/ingame_menu.gd index 47229f8..151bb2a 100644 --- a/ui/ingame_menu.gd +++ b/ui/ingame_menu/ingame_menu.gd @@ -1,8 +1,8 @@ -extends MarginContainer +extends Control class_name MonsterList @onready var monster_list_entry_container: MarginContainer = $MarginContainer/PanelContainer/VBoxContainer/MonsterListEntryContainer -@onready var monster_list_entry = preload("res://ui/monster_list_entry.tscn") +@onready var monster_list_entry = preload("res://ui/ingame_menu/party_list_entry.tscn") func _ready() -> void: visible = false diff --git a/ui/ingame_menu.tscn b/ui/ingame_menu/ingame_menu.tscn similarity index 85% rename from ui/ingame_menu.tscn rename to ui/ingame_menu/ingame_menu.tscn index 8cd5e06..ea7d1d2 100644 --- a/ui/ingame_menu.tscn +++ b/ui/ingame_menu/ingame_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=8 format=3 uid="uid://bbvbnrcjatkrb"] -[ext_resource type="Script" path="res://ui/ingame_menu.gd" id="1_beinb"] +[ext_resource type="Script" path="res://ui/ingame_menu/ingame_menu.gd" id="1_beinb"] [ext_resource type="FontFile" uid="uid://bjaavdnopfh0q" path="res://assets/fonts/aoboshi_one/AoboshiOne-Regular.ttf" id="2_1e4kf"] [ext_resource type="Texture2D" uid="uid://bhh31i3wgww43" path="res://assets/textures/Game Icons/Vector/2x/singleplayer.png" id="2_c2ia0"] [ext_resource type="Texture2D" uid="uid://c737p2osplq2o" path="res://assets/textures/Xbox Series/Vector/xbox_button_x_outline.svg" id="3_kgfth"] @@ -15,7 +15,8 @@ corner_radius_bottom_left = 64 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_flvbu"] -[node name="IngameMenu" type="MarginContainer"] +[node name="IngameMenu" type="Control"] +layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -24,7 +25,12 @@ grow_vertical = 2 script = ExtResource("1_beinb") [node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 2 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 theme_override_constants/margin_left = 50 theme_override_constants/margin_top = 50 theme_override_constants/margin_right = 50 @@ -73,6 +79,22 @@ layout_mode = 2 texture = ExtResource("3_oo4iu") expand_mode = 3 +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="PartyButton" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Party" + +[node name="Items" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Items" + +[node name="Player" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Player" + [node name="MonsterInfoTitle" type="MarginContainer" parent="MarginContainer/PanelContainer/VBoxContainer"] layout_mode = 2 theme_override_constants/margin_left = 40 diff --git a/ui/monster_list_entry.gd b/ui/ingame_menu/party_list_entry.gd similarity index 65% rename from ui/monster_list_entry.gd rename to ui/ingame_menu/party_list_entry.gd index e5fe955..cfa77f7 100644 --- a/ui/monster_list_entry.gd +++ b/ui/ingame_menu/party_list_entry.gd @@ -1,11 +1,11 @@ extends HBoxContainer -class_name MonsterListEntry +class_name PartyListEntry func populate(monster) -> void: %MonsterID.text = str(0) - %MonsterName.text = monster.display_name + %MonsterName.text = monster.name %MonsterLevel.text = "Lvl. %s" % monster.level %HealthProgressBar.value = monster.health %HealthProgressBar.max_value = monster.health %ExperienceProgressBar.value = monster.xp - %ExperienceProgressBar.max_value = monster.base_xp_for_next_level + %ExperienceProgressBar.max_value = monster.base_xp diff --git a/ui/monster_list_entry.tscn b/ui/ingame_menu/party_list_entry.tscn similarity index 93% rename from ui/monster_list_entry.tscn rename to ui/ingame_menu/party_list_entry.tscn index f3cbaa9..b0f22dd 100644 --- a/ui/monster_list_entry.tscn +++ b/ui/ingame_menu/party_list_entry.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=9 format=3 uid="uid://brp2sljqnkuhe"] -[ext_resource type="Texture2D" uid="uid://b6ylra30qxf30" path="res://assets/logo/logo.png" id="1_16gb7"] -[ext_resource type="Script" path="res://ui/monster_list_entry.gd" id="1_spojl"] -[ext_resource type="Texture2D" uid="uid://2vxx2waofxpw" path="res://assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg" id="2_5n4ar"] +[ext_resource type="Script" path="res://ui/ingame_menu/party_list_entry.gd" id="1_gdhy7"] +[ext_resource type="Texture2D" uid="uid://b6ylra30qxf30" path="res://assets/logo/logo.png" id="2_rogma"] +[ext_resource type="Texture2D" uid="uid://2vxx2waofxpw" path="res://assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg" id="3_etjt6"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_s3mod"] content_margin_top = 24.0 @@ -25,13 +25,13 @@ anchors_preset = 10 anchor_right = 1.0 offset_bottom = 72.0 grow_horizontal = 2 -script = ExtResource("1_spojl") +script = ExtResource("1_gdhy7") [node name="Thumbnail" type="TextureRect" parent="."] unique_name_in_owner = true custom_minimum_size = Vector2(70, 70) layout_mode = 2 -texture = ExtResource("1_16gb7") +texture = ExtResource("2_rogma") expand_mode = 3 [node name="VBoxContainer" type="VBoxContainer" parent="."] @@ -101,7 +101,7 @@ custom_minimum_size = Vector2(100, 100) layout_mode = 2 size_flags_horizontal = 8 theme_override_styles/focus = SubResource("StyleBoxEmpty_x2rfb") -icon = ExtResource("2_5n4ar") +icon = ExtResource("3_etjt6") flat = true icon_alignment = 1 expand_icon = true diff --git a/ui/main_menu.gd b/ui/main_menu/main_menu.gd similarity index 100% rename from ui/main_menu.gd rename to ui/main_menu/main_menu.gd diff --git a/ui/main_menu.tscn b/ui/main_menu/main_menu.tscn similarity index 98% rename from ui/main_menu.tscn rename to ui/main_menu/main_menu.tscn index 16f1cac..5f88c7e 100644 --- a/ui/main_menu.tscn +++ b/ui/main_menu/main_menu.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=10 format=3 uid="uid://dt00rjsodtady"] [ext_resource type="Texture2D" uid="uid://b6ylra30qxf30" path="res://assets/logo/logo.png" id="1_1fmce"] -[ext_resource type="Script" path="res://ui/main_menu.gd" id="1_5gs73"] +[ext_resource type="Script" path="res://ui/main_menu/main_menu.gd" id="1_5gs73"] [ext_resource type="FontFile" uid="uid://bjaavdnopfh0q" path="res://assets/fonts/aoboshi_one/AoboshiOne-Regular.ttf" id="2_aqmkw"] [ext_resource type="Texture2D" uid="uid://da7o6lfuoliid" path="res://assets/textures/Backgrounds/meadow2.jpg" id="2_bb61v"] diff --git a/ui/styles/battle_ui_move_normal_button.tres b/ui/styles/battle_ui_move_normal_button.tres new file mode 100644 index 0000000..177af97 --- /dev/null +++ b/ui/styles/battle_ui_move_normal_button.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://dccmukg8pfc66"] + +[resource] +content_margin_left = 0.0 +content_margin_top = 0.0 +content_margin_right = 0.0 +content_margin_bottom = 0.0 +bg_color = Color(0, 0, 0, 0.705882) +corner_radius_top_left = 6 +corner_radius_top_right = 6 +corner_radius_bottom_right = 6 +corner_radius_bottom_left = 6 diff --git a/ui/styles/battle_ui_normal_button.tres b/ui/styles/battle_ui_normal_button.tres new file mode 100644 index 0000000..783c616 --- /dev/null +++ b/ui/styles/battle_ui_normal_button.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://ddtjhp2lob6to"] + +[resource] +content_margin_left = 16.0 +content_margin_top = 16.0 +content_margin_right = 16.0 +content_margin_bottom = 16.0 +bg_color = Color(0, 0, 0, 0.705882) +corner_radius_top_left = 6 +corner_radius_top_right = 6 +corner_radius_bottom_right = 6 +corner_radius_bottom_left = 6 diff --git a/ui/styles/battle_ui_pressed_button.tres b/ui/styles/battle_ui_pressed_button.tres new file mode 100644 index 0000000..81b7693 --- /dev/null +++ b/ui/styles/battle_ui_pressed_button.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://cv8ispcxuwjn5"] + +[resource] +content_margin_left = 16.0 +content_margin_top = 16.0 +content_margin_right = 16.0 +content_margin_bottom = 16.0 +bg_color = Color(0.92, 0.889333, 0, 0.901961) +corner_radius_top_left = 6 +corner_radius_top_right = 6 +corner_radius_bottom_right = 6 +corner_radius_bottom_left = 6 diff --git a/ui/ui.gd b/ui/ui.gd index 53686f5..5323b62 100644 --- a/ui/ui.gd +++ b/ui/ui.gd @@ -5,12 +5,12 @@ extends Node signal on_new_game_started signal on_game_continued -@onready var root: CanvasLayer = $/root/Game/UI -@onready var main_menu: Control = $/root/Game/UI/MainMenu -@onready var ingame_controls: MarginContainer = $/root/Game/UI/IngameControls -@onready var ingame_menu: Control = $/root/Game/UI/IngameMenu -@onready var camera_control_area : Control = $/root/Game/UI/CameraControlArea -@onready var save_ui : Control = $/root/Game/UI/SaveUI +@onready var main_menu: Control = $MainMenu +@onready var ingame_controls: Control = $IngameControls +@onready var ingame_menu: Control = $IngameMenu +@onready var camera_control_area : Control = $CameraControlArea +@onready var save_ui : Control = $SaveUI +@onready var battle_ui : Control = $BattleUI func _ready() -> void: main_menu.connect("on_game_continued", _on_main_menu_on_game_continued) @@ -30,6 +30,9 @@ func show_main_menu(p_visible = true) -> void: func show_ingame_controls(p_visible = true) -> void: ingame_controls.visible = p_visible +func show_battle_ui(p_visible = true) -> void: + battle_ui.visible = p_visible + func _on_ingame_controls_menu_button_clicked() -> void: ingame_menu.visible = true diff --git a/ui/ui.tscn b/ui/ui.tscn index 745c970..96885e8 100644 --- a/ui/ui.tscn +++ b/ui/ui.tscn @@ -1,11 +1,14 @@ -[gd_scene load_steps=5 format=3 uid="uid://b5y7pdfe6ougf"] +[gd_scene load_steps=7 format=3 uid="uid://b5y7pdfe6ougf"] -[ext_resource type="Script" path="res://ui/camera_controls.gd" id="1_x56x6"] -[ext_resource type="PackedScene" uid="uid://dt00rjsodtady" path="res://ui/main_menu.tscn" id="3_tcmm8"] -[ext_resource type="PackedScene" uid="uid://1anjhvi173g3" path="res://ui/ingame_controls.tscn" id="4_likk0"] -[ext_resource type="PackedScene" uid="uid://bbvbnrcjatkrb" path="res://ui/ingame_menu.tscn" id="5_qjqu1"] +[ext_resource type="Script" path="res://ui/ui.gd" id="1_fkttd"] +[ext_resource type="Script" path="res://ui/ingame_controls/camera_controls.gd" id="1_x56x6"] +[ext_resource type="PackedScene" uid="uid://dt00rjsodtady" path="res://ui/main_menu/main_menu.tscn" id="3_tcmm8"] +[ext_resource type="PackedScene" uid="uid://1anjhvi173g3" path="res://ui/ingame_controls/ingame_controls.tscn" id="4_likk0"] +[ext_resource type="PackedScene" uid="uid://bbvbnrcjatkrb" path="res://ui/ingame_menu/ingame_menu.tscn" id="5_qjqu1"] +[ext_resource type="PackedScene" uid="uid://dyroahq85mhws" path="res://ui/battle_ui/battle_ui.tscn" id="6_uxa7j"] [node name="UI" type="CanvasLayer"] +script = ExtResource("1_fkttd") [node name="CameraControlArea" type="Control" parent="."] layout_mode = 3 @@ -51,6 +54,7 @@ vertical_alignment = 1 [node name="MainMenu" parent="." instance=ExtResource("3_tcmm8")] unique_name_in_owner = true +visible = false [node name="IngameControls" parent="." instance=ExtResource("4_likk0")] unique_name_in_owner = true @@ -59,3 +63,5 @@ visible = false [node name="IngameMenu" parent="." instance=ExtResource("5_qjqu1")] unique_name_in_owner = true visible = false + +[node name="BattleUI" parent="." instance=ExtResource("6_uxa7j")] diff --git a/worlds/debug_level.tscn b/worlds/debug_level.tscn deleted file mode 100644 index 7282b50..0000000 --- a/worlds/debug_level.tscn +++ /dev/null @@ -1,60 +0,0 @@ -[gd_scene load_steps=11 format=3 uid="uid://bgngmj53lc15q"] - -[ext_resource type="PackedScene" uid="uid://dawpmu4vvv3rs" path="res://entities/monster_spawnpoint/monster_spawnpoint.tscn" id="3_esgto"] -[ext_resource type="Script" path="res://resources/monster_data.gd" id="3_iktqp"] -[ext_resource type="Resource" uid="uid://0xqaef8uftnv" path="res://resources/monsters/debuggy.tres" id="4_noslo"] -[ext_resource type="PackedScene" uid="uid://dibg4wpthwdov" path="res://entities/healing_station/healing_station.tscn" id="4_xewui"] - -[sub_resource type="PlaneMesh" id="PlaneMesh_wak6a"] -size = Vector2(1000, 1000) - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8wti1"] -albedo_color = Color(0.157906, 0.300646, 0.191269, 1) - -[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_m4bnl"] - -[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_g80j5"] -sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) -ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) - -[sub_resource type="Sky" id="Sky_wlahx"] -sky_material = SubResource("ProceduralSkyMaterial_g80j5") - -[sub_resource type="Environment" id="Environment_rwve8"] -background_mode = 2 -sky = SubResource("Sky_wlahx") -tonemap_mode = 2 -glow_enabled = true - -[node name="DebugLevel" type="Node3D"] - -[node name="Floor" type="StaticBody3D" parent="."] -collision_layer = 2 -collision_mask = 13 -metadata/_edit_lock_ = true - -[node name="FloorMesh" type="MeshInstance3D" parent="Floor"] -mesh = SubResource("PlaneMesh_wak6a") -skeleton = NodePath("../..") -surface_material_override/0 = SubResource("StandardMaterial3D_8wti1") -metadata/_edit_lock_ = true - -[node name="CollisionShape3D" type="CollisionShape3D" parent="Floor"] -shape = SubResource("WorldBoundaryShape3D_m4bnl") -metadata/_edit_lock_ = true - -[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] -transform = Transform3D(0.224144, 0.474445, -0.851271, 0.12941, 0.851271, 0.508518, 0.965926, -0.224144, 0.129409, 0, 0, 0) -shadow_enabled = true - -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = SubResource("Environment_rwve8") - -[node name="MonsterSpawnpoint" parent="." instance=ExtResource("3_esgto")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.6673, 0, -8.88992) -spawnable_monsters = Array[ExtResource("3_iktqp")]([ExtResource("4_noslo")]) -ignore_visibility = true -max_monsters = 1 - -[node name="HealingStation" parent="." instance=ExtResource("4_xewui")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.26308, 0, -1.63961) diff --git a/worlds/world1/world1.tscn b/worlds/world1/world1.tscn index 5710afe..fb3b241 100644 --- a/worlds/world1/world1.tscn +++ b/worlds/world1/world1.tscn @@ -1,8 +1,27 @@ -[gd_scene load_steps=11 format=3 uid="uid://bhhqaysqjw2d"] +[gd_scene load_steps=30 format=3 uid="uid://bhhqaysqjw2d"] [ext_resource type="PackedScene" uid="uid://dawpmu4vvv3rs" path="res://entities/monster_spawnpoint/monster_spawnpoint.tscn" id="1_3qqsk"] [ext_resource type="Script" path="res://entities/monster_spawnpoint/monster_spawnpoint_probability.gd" id="2_pmb72"] [ext_resource type="Resource" uid="uid://0xqaef8uftnv" path="res://resources/monsters/debuggy.tres" id="3_rfdrv"] +[ext_resource type="ArrayMesh" uid="uid://cack8j00xjsa3" path="res://assets/models/environment/kenney_nature-kit/log_stackLarge.obj" id="4_0kbbq"] +[ext_resource type="ArrayMesh" uid="uid://btg2gsgk1war7" path="res://assets/models/environment/kenney_nature-kit/log_stack.obj" id="5_qmkbs"] +[ext_resource type="ArrayMesh" uid="uid://dafdq71e86ho5" path="res://assets/models/environment/kenney_nature-kit/mushroom_red.obj" id="6_srojq"] +[ext_resource type="ArrayMesh" uid="uid://cm8is5hix18dl" path="res://assets/models/environment/kenney_nature-kit/mushroom_redGroup.obj" id="7_1s3h0"] +[ext_resource type="ArrayMesh" uid="uid://bui1lf0llkibd" path="res://assets/models/environment/kenney_nature-kit/mushroom_tan.obj" id="8_4wcxw"] +[ext_resource type="ArrayMesh" uid="uid://iowq0losn4td" path="res://assets/models/environment/kenney_nature-kit/path_stone.obj" id="9_bpmfr"] +[ext_resource type="ArrayMesh" uid="uid://bdj5dw462e77p" path="res://assets/models/environment/kenney_nature-kit/path_stoneCircle.obj" id="10_fjaao"] +[ext_resource type="ArrayMesh" uid="uid://dvcmkl0qfpg73" path="res://assets/models/environment/kenney_nature-kit/path_stoneEnd.obj" id="11_wn62q"] +[ext_resource type="ArrayMesh" uid="uid://bh00ibc6phtqk" path="res://assets/models/environment/kenney_nature-kit/plant_flatShort.obj" id="12_bywwm"] +[ext_resource type="ArrayMesh" uid="uid://dh0xwow8ugf7a" path="res://assets/models/environment/kenney_nature-kit/plant_bushSmall.obj" id="13_3qtcp"] +[ext_resource type="ArrayMesh" uid="uid://c68imp6yppj6y" path="res://assets/models/environment/kenney_nature-kit/plant_bushTriangle.obj" id="14_vwj3k"] +[ext_resource type="ArrayMesh" uid="uid://djgt5pp8x0vjk" path="res://assets/models/environment/kenney_nature-kit/platform_grass.obj" id="15_gt7yq"] +[ext_resource type="ArrayMesh" uid="uid://bsjy4ga2fgkmu" path="res://assets/models/environment/kenney_nature-kit/rock_smallE.obj" id="16_i3jgm"] +[ext_resource type="ArrayMesh" uid="uid://rhmh3diwn67f" path="res://assets/models/environment/kenney_nature-kit/rock_tallA.obj" id="17_hrfs1"] +[ext_resource type="ArrayMesh" uid="uid://diuegcyvoa1gi" path="res://assets/models/environment/kenney_nature-kit/sign.obj" id="18_3oreg"] +[ext_resource type="ArrayMesh" uid="uid://cxqtsthjrf456" path="res://assets/models/environment/kenney_nature-kit/tree_oak_dark.obj" id="19_7q86a"] +[ext_resource type="ArrayMesh" uid="uid://dvcxsgd2tjhce" path="res://assets/models/environment/kenney_nature-kit/tree_small.obj" id="20_p3pyd"] +[ext_resource type="ArrayMesh" uid="uid://kk0vopaeqry0" path="res://assets/models/environment/kenney_nature-kit/tree_fat.obj" id="21_m2vvv"] +[ext_resource type="ArrayMesh" uid="uid://bkbtamud66sc8" path="res://assets/models/environment/kenney_nature-kit/grass_large.obj" id="22_ee3ig"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_xgcdx"] sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) @@ -53,9 +72,153 @@ shape = SubResource("WorldBoundaryShape3D_pjix1") mesh = SubResource("QuadMesh_ry8lc") surface_material_override/0 = SubResource("StandardMaterial3D_u86mj") +[node name="Trees" type="Node3D" parent="."] + +[node name="LogStackLarge" type="MeshInstance3D" parent="Trees"] +transform = Transform3D(1.66935, 0, -1.10149, 0, 2, 0, 1.10149, 0, 1.66935, 1.6177, 0, -1.49863) +mesh = ExtResource("4_0kbbq") +skeleton = NodePath("../..") + +[node name="LogStack" type="MeshInstance3D" parent="Trees"] +transform = Transform3D(1.11998, 0, 1.657, 0, 2, 0, -1.657, 0, 1.11998, -2.38713, 0, -2.21448) +mesh = ExtResource("5_qmkbs") +skeleton = NodePath("../..") + +[node name="TreeOakDark" type="MeshInstance3D" parent="Trees"] +transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 5.48297, 0, -9.46487) +mesh = ExtResource("19_7q86a") +skeleton = NodePath("../..") + +[node name="TreeSmall" type="MeshInstance3D" parent="Trees"] +transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 5.76902, 0, -7.6399) +mesh = ExtResource("20_p3pyd") +skeleton = NodePath("../..") + +[node name="TreeFat" type="MeshInstance3D" parent="Trees"] +transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 11.8738, 0, -2.86255) +mesh = ExtResource("21_m2vvv") +skeleton = NodePath("../..") + +[node name="Rocks" type="Node3D" parent="."] + +[node name="PathStone" type="MeshInstance3D" parent="Rocks"] +transform = Transform3D(0.859424, 0, 0.511263, 0, 1, 0, -0.511263, 0, 0.859424, -1.12448, 1.19209e-07, -0.931548) +mesh = ExtResource("9_bpmfr") +skeleton = NodePath("../..") + +[node name="PathStoneCircle" type="MeshInstance3D" parent="Rocks"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.301247, 0, -1.70981) +mesh = ExtResource("10_fjaao") +skeleton = NodePath("../..") + +[node name="PathStoneEnd" type="MeshInstance3D" parent="Rocks"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.459289, 0, -2.53599) +mesh = ExtResource("11_wn62q") +skeleton = NodePath("../..") + +[node name="PlatformGrass" type="MeshInstance3D" parent="Rocks"] +transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 3.5655, 0, -2.31577) +mesh = ExtResource("15_gt7yq") +skeleton = NodePath("../..") + +[node name="RockSmallE" type="MeshInstance3D" parent="Rocks"] +transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 4.86258, 0, -2.69259) +mesh = ExtResource("16_i3jgm") +skeleton = NodePath("../..") + +[node name="RockTallA" type="MeshInstance3D" parent="Rocks"] +transform = Transform3D(2.92839, 0, -9.56162, 0, 10, 0, 9.56162, 0, 2.92839, 10.1956, 0, -8.29341) +mesh = ExtResource("17_hrfs1") +skeleton = NodePath("../..") + +[node name="Bushes" type="Node3D" parent="."] + +[node name="PlantFlatShort" type="MeshInstance3D" parent="Bushes"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.66921, 0, -1.61654) +mesh = ExtResource("12_bywwm") +skeleton = NodePath("../..") + +[node name="PlantBushSmall" type="MeshInstance3D" parent="Bushes"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.175514, -0.0621889, -2.47413) +mesh = ExtResource("13_3qtcp") +skeleton = NodePath("../..") + +[node name="PlantBushTriangle" type="MeshInstance3D" parent="Bushes"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.919819, -0.0390102, -1.71797) +mesh = ExtResource("14_vwj3k") +skeleton = NodePath("../..") + [node name="MonsterSpawnpoints" type="Node3D" parent="."] [node name="MonsterSpawnpointDebug" parent="MonsterSpawnpoints" instance=ExtResource("1_3qqsk")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, -9) spawnable_monsters = Array[ExtResource("2_pmb72")]([SubResource("Resource_13u2y")]) ignore_visibility = true + +[node name="Mushrooms" type="Node3D" parent="."] + +[node name="MushroomRed" type="MeshInstance3D" parent="Mushrooms"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.12814, 0, -0.683066) +mesh = ExtResource("6_srojq") +skeleton = NodePath("../..") + +[node name="MushroomRedGroup" type="MeshInstance3D" parent="Mushrooms"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.69394, 0, -0.409612) +mesh = ExtResource("7_1s3h0") +skeleton = NodePath("../..") + +[node name="MushroomTan" type="MeshInstance3D" parent="Mushrooms"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.60805, 0, -1.48199) +mesh = ExtResource("8_4wcxw") +skeleton = NodePath("../..") + +[node name="Sign" type="MeshInstance3D" parent="."] +transform = Transform3D(0.463141, 0, 0.886284, 0, 1, 0, -0.886284, 0, 0.463141, 3.17387, 0.0125848, -2.34009) +mesh = ExtResource("18_3oreg") + +[node name="Grass" type="Node3D" parent="."] + +[node name="GrassLarge" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(1.72649, 0, -1.00957, 0, 2.5, 0, 1.00957, 0, 1.72649, -3.2048, 0, -9.39117) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge2" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(1.72649, 0, -1.00957, 0, 2.5, 0, 1.00957, 0, 1.72649, -2.21933, 0, -9.61515) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge3" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(1.99626, 0, -0.122271, 0, 2.5, 0, 0.122271, 0, 1.99626, -2.51043, 0, -8.48302) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge4" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(-0.42166, 0, -1.95505, 0, 2.5, 0, 1.95505, 0, -0.42166, -3.50344, 0, -8.53657) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge5" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(1.07127, 0, -1.6889, 0, 2.5, 0, 1.6889, 0, 1.07127, -1.43608, 0, -8.94263) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge6" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(-0.743805, 0, -1.85654, 0, 2.5, 0, 1.85654, 0, -0.743805, -1.19168, 0, -9.94279) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge7" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(0.304178, 0, -1.97673, 0, 2.5, 0, 1.97673, 0, 0.304178, -0.56479, 0, -9.30819) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge8" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(0.945778, 0, -1.76224, 0, 2.5, 0, 1.76224, 0, 0.945778, -0.671405, 0, -8.33458) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..") + +[node name="GrassLarge9" type="MeshInstance3D" parent="Grass"] +transform = Transform3D(-1.12264, 0, -1.6552, 0, 2.5, 0, 1.6552, 0, -1.12264, -1.61198, 2.38419e-07, -7.95919) +mesh = ExtResource("22_ee3ig") +skeleton = NodePath("../..")