diff --git a/assets/prototipos/escena/Duel/battle_background.png b/assets/prototipos/escena/Duel/battle_background.png new file mode 100644 index 0000000..5451e53 Binary files /dev/null and b/assets/prototipos/escena/Duel/battle_background.png differ diff --git a/assets/prototipos/escena/Duel/battle_template.png b/assets/prototipos/escena/Duel/battle_template.png new file mode 100644 index 0000000..678cc3a Binary files /dev/null and b/assets/prototipos/escena/Duel/battle_template.png differ diff --git a/assets/prototipos/escena/Duel/boss_battle_background.png b/assets/prototipos/escena/Duel/boss_battle_background.png new file mode 100644 index 0000000..75c0c6d Binary files /dev/null and b/assets/prototipos/escena/Duel/boss_battle_background.png differ diff --git a/assets/prototipos/escena/Duel/deck_pile.png b/assets/prototipos/escena/Duel/deck_pile.png new file mode 100644 index 0000000..83aa27b Binary files /dev/null and b/assets/prototipos/escena/Duel/deck_pile.png differ diff --git a/assets/prototipos/escena/Duel/deck_pile_1.png b/assets/prototipos/escena/Duel/deck_pile_1.png new file mode 100644 index 0000000..5ade14e Binary files /dev/null and b/assets/prototipos/escena/Duel/deck_pile_1.png differ diff --git a/assets/prototipos/escena/Duel/deck_pile_2.png b/assets/prototipos/escena/Duel/deck_pile_2.png new file mode 100644 index 0000000..5529384 Binary files /dev/null and b/assets/prototipos/escena/Duel/deck_pile_2.png differ diff --git a/assets/prototipos/escena/Duel/discard_icon.png b/assets/prototipos/escena/Duel/discard_icon.png new file mode 100644 index 0000000..c5a9147 Binary files /dev/null and b/assets/prototipos/escena/Duel/discard_icon.png differ diff --git a/assets/prototipos/escena/Duel/hud.png b/assets/prototipos/escena/Duel/hud.png new file mode 100644 index 0000000..e76c735 Binary files /dev/null and b/assets/prototipos/escena/Duel/hud.png differ diff --git a/assets/prototipos/escena/Duel/status_icon.png b/assets/prototipos/escena/Duel/status_icon.png new file mode 100644 index 0000000..8899d17 Binary files /dev/null and b/assets/prototipos/escena/Duel/status_icon.png differ diff --git a/assets/prototipos/lobby_background.png b/assets/prototipos/escena/lobby_background.png similarity index 100% rename from assets/prototipos/lobby_background.png rename to assets/prototipos/escena/lobby_background.png diff --git a/assets/prototipos/personaje/battle_template.png b/assets/prototipos/personaje/battle_template.png new file mode 100644 index 0000000..678cc3a Binary files /dev/null and b/assets/prototipos/personaje/battle_template.png differ diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..61a5ef9 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,42 @@ +[preset.0] + +name="Test" +platform="Windows Desktop" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="**/*.json" +exclude_filter="" +export_path="../morgana.exe" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=true +binary_format/embed_pck=false +custom_template/release="" +custom_template/debug="" +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PoolStringArray( ) +application/icon="" +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" diff --git a/project.godot b/project.godot index 86b4e13..a56ba65 100644 --- a/project.godot +++ b/project.godot @@ -93,6 +93,10 @@ EnemiesDatabase="*res://real_deal/scripts/utils/enemies_database.gd" [display] +window/size/width=1920 +window/size/height=1080 +window/size/test_width=1280 +window/size/test_height=720 window/stretch/mode="2d" window/stretch/aspect="keep" diff --git a/real_deal/scenes/duel/DuelEnemy.tscn b/real_deal/scenes/duel/DuelEnemy.tscn index 3cc7091..e63f526 100644 --- a/real_deal/scenes/duel/DuelEnemy.tscn +++ b/real_deal/scenes/duel/DuelEnemy.tscn @@ -1,36 +1,98 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://real_deal/scripts/duel/DuelEnemy.gd" type="Script" id=1] [ext_resource path="res://assets/animations/slime_normal.tres" type="SpriteFrames" id=2] [ext_resource path="res://assets/gris.png" type="Texture" id=3] [ext_resource path="res://assets/rojo.png" type="Texture" id=4] +[ext_resource path="res://assets/fonts/Comfortaa-Bold.ttf" type="DynamicFontData" id=5] -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 108.893, 93.6324 ) +[sub_resource type="CircleShape2D" id=1] +radius = 17.6002 -[node name="Battle_Enemy_Swampy" type="Area2D"] -scale = Vector2( 2, 2 ) +[sub_resource type="DynamicFont" id=2] +font_data = ExtResource( 5 ) + +[node name="DuelEnemy" type="Area2D"] script = ExtResource( 1 ) [node name="Character" type="AnimatedSprite" parent="."] +position = Vector2( 213.862, 309.96 ) +scale = Vector2( 1.6473, 1.6473 ) frames = ExtResource( 2 ) animation = "idle" flip_h = true +__meta__ = { +"_editor_description_": "" +} -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 1 ) +[node name="HealthBarContainer" type="MarginContainer" parent="."] +margin_right = 432.0 +margin_bottom = 570.0 +custom_constants/margin_top = 515 +custom_constants/margin_bottom = 40 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Container" type="CenterContainer" parent="HealthBarContainer"] +margin_top = 515.0 +margin_right = 432.0 +margin_bottom = 530.0 -[node name="HealthBar" type="TextureProgress" parent="."] -margin_left = -108.505 -margin_top = 83.9132 -margin_right = 108.495 -margin_bottom = 98.9132 +[node name="HealthBar" type="TextureProgress" parent="HealthBarContainer/Container"] +margin_left = 107.0 +margin_right = 324.0 +margin_bottom = 15.0 +value = 20.0 texture_under = ExtResource( 3 ) texture_progress = ExtResource( 4 ) __meta__ = { +"_editor_description_": "" +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 222, 320 ) +scale = Vector2( 10, 10 ) +shape = SubResource( 1 ) + +[node name="NameContainer" type="MarginContainer" parent="."] +margin_right = 432.0 +margin_bottom = 570.0 +custom_constants/margin_top = 415 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Name" type="Label" parent="NameContainer"] +margin_top = 483.0 +margin_right = 432.0 +margin_bottom = 502.0 +mouse_default_cursor_shape = 2 +custom_fonts/font = SubResource( 2 ) +text = "DefaultName" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "" +} + +[node name="StatesContainer" type="MarginContainer" parent="."] +margin_right = 432.0 +margin_bottom = 570.0 +custom_constants/margin_top = 535 +__meta__ = { "_edit_use_anchors_": false } + +[node name="States" type="HBoxContainer" parent="StatesContainer"] +margin_top = 535.0 +margin_right = 432.0 +margin_bottom = 570.0 +custom_constants/separation = 2 + +[node name="EnemyLeftPosition" type="Position2D" parent="."] +position = Vector2( 216, 470 ) [connection signal="card_target" from="." to="." method="_on_Battle_Enemy_Swampy_card_target"] [connection signal="not_card_target" from="." to="." method="_on_Battle_Enemy_Swampy_not_card_target"] -[connection signal="playCard" from="." to="." method="_on_Battle_Enemy_Swampy_playCard"] [connection signal="animation_finished" from="Character" to="." method="_on_Character_animation_finished"] diff --git a/real_deal/scenes/duel/DuelManager.tscn b/real_deal/scenes/duel/DuelManager.tscn index 4ab2163..3ed946f 100644 --- a/real_deal/scenes/duel/DuelManager.tscn +++ b/real_deal/scenes/duel/DuelManager.tscn @@ -1,10 +1,22 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://real_deal/scenes/utils/MouseCollision.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/prototipos/escena/Duel/battle_background.png" type="Texture" id=2] [ext_resource path="res://real_deal/scripts/duel/DuelManager.gd" type="Script" id=3] [ext_resource path="res://assets/prototipos/escena_tileset.tres" type="TileSet" id=4] -[ext_resource path="res://assets/prototipos/characters_sprites/crate.png" type="Texture" id=5] -[ext_resource path="res://real_deal/scenes/duel/DuelLife.tscn" type="PackedScene" id=6] +[ext_resource path="res://real_deal/scripts/duel/DuelLife.gd" type="Script" id=5] +[ext_resource path="res://assets/prototipos/escena/Duel/deck_pile.png" type="Texture" id=6] +[ext_resource path="res://assets/prototipos/escena/Duel/battle_template.png" type="Texture" id=7] +[ext_resource path="res://assets/prototipos/escena/Duel/hud.png" type="Texture" id=8] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 265, 115 ) + +[sub_resource type="StyleBoxFlat" id=4] +bg_color = Color( 0.184314, 0.678431, 0.027451, 1 ) + +[sub_resource type="StyleBoxFlat" id=3] +bg_color = Color( 0.219608, 0, 0.356863, 1 ) [node name="Main" type="Control"] anchor_right = 1.0 @@ -18,7 +30,17 @@ __meta__ = { [node name="Fondo" type="Node2D" parent="."] +[node name="BackgroundGuide" type="Sprite" parent="Fondo"] +visible = false +texture = ExtResource( 7 ) +centered = false + +[node name="Background" type="Sprite" parent="Fondo"] +texture = ExtResource( 2 ) +centered = false + [node name="Base" type="TileMap" parent="Fondo"] +visible = false scale = Vector2( 0.5, 0.5 ) tile_set = ExtResource( 4 ) cell_size = Vector2( 400, 400 ) @@ -27,6 +49,7 @@ format = 1 tile_data = PoolIntArray( 0, 8, 0, 1, 8, 0, 2, 8, 0, 3, 8, 0, 4, 8, 0, 5, 8, 0, 131071, 8, 0, 65536, 8, 0, 65537, 8, 0, 65538, 8, 0, 65539, 8, 0, 65540, 8, 0, 65541, 8, 0, 196607, 8, 0, 131072, 8, 0, 131073, 8, 0, 131074, 8, 0, 131075, 8, 0, 131076, 8, 0, 131077, 8, 0, 262143, 8, 0, 196608, 8, 0, 196609, 8, 0, 196610, 8, 0, 196611, 8, 0, 196612, 8, 0, 196613, 8, 0 ) [node name="Nubes" type="TileMap" parent="Fondo"] +visible = false scale = Vector2( 0.5, 0.5 ) tile_set = ExtResource( 4 ) cell_size = Vector2( 400, 400 ) @@ -37,56 +60,84 @@ tile_data = PoolIntArray( 65535, 15, 0, 0, 15, 0, 1, 11, 0, 2, 10, 0, 3, 13, 0, [node name="UI_Elements_left" type="MarginContainer" parent="."] anchor_top = 1.0 anchor_bottom = 1.0 -margin_left = 27.7183 -margin_top = -84.6965 -margin_right = 55.7183 -margin_bottom = -56.6965 -rect_scale = Vector2( 2, 2 ) +margin_top = -231.0 +margin_right = 531.0 +rect_min_size = Vector2( 531, 231 ) __meta__ = { -"_edit_group_": true, "_edit_use_anchors_": false } -[node name="Button" type="Button" parent="UI_Elements_left"] -margin_right = 28.0 -margin_bottom = 28.0 -icon = ExtResource( 5 ) -__meta__ = { -"_edit_use_anchors_": false -} +[node name="Area2D" type="Area2D" parent="UI_Elements_left"] +script = ExtResource( 5 ) -[node name="Hand" type="Node" parent="."] +[node name="Sprite" type="Sprite" parent="UI_Elements_left/Area2D"] +texture = ExtResource( 8 ) +centered = false -[node name="UI_Elements_right" type="MarginContainer" parent="."] -anchor_left = 1.0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = -50.4169 -margin_top = -109.538 -margin_right = -46.4169 -margin_bottom = -95.5383 -__meta__ = { -"_edit_group_": true, -"_edit_use_anchors_": false -} +[node name="CollisionShape2D" type="CollisionShape2D" parent="UI_Elements_left/Area2D"] +position = Vector2( 265, 115 ) +shape = SubResource( 1 ) -[node name="ProgressBar" parent="UI_Elements_right" instance=ExtResource( 6 )] +[node name="BarConatiner" type="MarginContainer" parent="UI_Elements_left"] +margin_right = 531.0 +margin_bottom = 231.0 +custom_constants/margin_top = 188 -[node name="Player" type="Position2D" parent="."] -position = Vector2( 1380.94, 299.762 ) +[node name="ProgressBar" type="ProgressBar" parent="UI_Elements_left/BarConatiner"] +margin_top = 188.0 +margin_right = 531.0 +margin_bottom = 218.0 +rect_min_size = Vector2( 500, 30 ) +custom_styles/fg = SubResource( 4 ) +custom_styles/bg = SubResource( 3 ) -[node name="Enemigos" type="Node" parent="."] +[node name="Hand" type="Node" parent="."] -[node name="Enemy_0" type="Position2D" parent="Enemigos"] -position = Vector2( 516.433, 241.43 ) +[node name="Player" type="Position2D" parent="."] +position = Vector2( 1380.94, 299.762 ) -[node name="Enemy_1" type="Position2D" parent="Enemigos"] -position = Vector2( 192.042, 265.002 ) +[node name="Enemigos" type="HBoxContainer" parent="."] +margin_left = 310.0 +margin_top = 75.0 +margin_right = 1610.0 +margin_bottom = 645.0 +rect_min_size = Vector2( 1200, 500 ) +custom_constants/separation = 0 +alignment = 1 +__meta__ = { +"_edit_use_anchors_": false +} -[node name="Enemy_2" type="Position2D" parent="Enemigos"] -position = Vector2( 819.498, 267.247 ) +[node name="Enemy_0" type="CenterContainer" parent="Enemigos"] +margin_left = 2.0 +margin_right = 434.0 +margin_bottom = 570.0 +rect_min_size = Vector2( 432, 0 ) + +[node name="Enemy_1" type="CenterContainer" parent="Enemigos"] +margin_left = 434.0 +margin_right = 866.0 +margin_bottom = 570.0 +rect_min_size = Vector2( 432, 0 ) + +[node name="Enemy_2" type="CenterContainer" parent="Enemigos"] +margin_left = 866.0 +margin_right = 1298.0 +margin_bottom = 570.0 +rect_min_size = Vector2( 432, 0 ) + +[node name="Button" type="Button" parent="."] +margin_left = 1651.29 +margin_top = 753.142 +margin_right = 1879.29 +margin_bottom = 1050.14 +icon = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": false +} [connection signal="addCard" from="." to="." method="_on_Main_addCard"] [connection signal="playCard" from="." to="." method="_on_Main_playCard"] [connection signal="removeCard" from="." to="." method="_on_Main_removeCard"] -[connection signal="pressed" from="UI_Elements_left/Button" to="." method="_on_Button_pressed"] +[connection signal="card_target" from="UI_Elements_left/Area2D" to="UI_Elements_left/Area2D" method="_on_Area2D_card_target"] +[connection signal="not_card_target" from="UI_Elements_left/Area2D" to="UI_Elements_left/Area2D" method="_on_Area2D_not_card_target"] +[connection signal="pressed" from="Button" to="." method="_on_Button_pressed"] diff --git a/real_deal/scenes/duel/DuelManager_old.tscn b/real_deal/scenes/duel/DuelManager_old.tscn index 16bff95..dec8a3c 100644 --- a/real_deal/scenes/duel/DuelManager_old.tscn +++ b/real_deal/scenes/duel/DuelManager_old.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://real_deal/scripts/duel/DuelManager.gd" type="Script" id=1] [ext_resource path="res://real_deal/scenes/duel/DuelLife.tscn" type="PackedScene" id=2] -[ext_resource path="res://real_deal/scenes/duel/DuelHand.tscn" type="PackedScene" id=3] +[ext_resource path="res://real_deal/scenes/duel/DuelPlayer.tscn" type="PackedScene" id=3] [ext_resource path="res://real_deal/scenes/utils/MouseCollision.tscn" type="PackedScene" id=4] [ext_resource path="res://assets/prototipos/albertoV_dungeon_background.png" type="Texture" id=5] [ext_resource path="res://assets/prototipos/characters_sprites/crate.png" type="Texture" id=6] diff --git a/real_deal/scenes/menu/MainMenu.tscn b/real_deal/scenes/menu/MainMenu.tscn index c28cc9e..e9a539b 100644 --- a/real_deal/scenes/menu/MainMenu.tscn +++ b/real_deal/scenes/menu/MainMenu.tscn @@ -26,13 +26,13 @@ __meta__ = { } [node name="LeftIcons" type="HBoxContainer" parent="MarginContainer"] -margin_right = 984.0 -margin_bottom = 560.0 +margin_right = 1880.0 +margin_bottom = 1040.0 mouse_filter = 2 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/LeftIcons"] margin_right = 48.0 -margin_bottom = 560.0 +margin_bottom = 1040.0 mouse_filter = 2 [node name="OptionsButton" type="Button" parent="MarginContainer/LeftIcons/VBoxContainer"] @@ -43,23 +43,23 @@ text = "Menú" align = 2 [node name="CenterIcons" type="HBoxContainer" parent="MarginContainer"] -margin_right = 984.0 -margin_bottom = 560.0 +margin_right = 1880.0 +margin_bottom = 1040.0 mouse_filter = 2 alignment = 1 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterIcons"] -margin_left = 417.0 -margin_right = 566.0 -margin_bottom = 560.0 +margin_left = 865.0 +margin_right = 1014.0 +margin_bottom = 1040.0 mouse_filter = 2 custom_constants/separation = 10 alignment = 1 [node name="TitleName" type="Label" parent="MarginContainer/CenterIcons/VBoxContainer"] -margin_top = 227.0 +margin_top = 467.0 margin_right = 149.0 -margin_bottom = 258.0 +margin_bottom = 498.0 text = "PERO MIRA QUE JUEGO MÁS BONICO" align = 1 @@ -69,17 +69,17 @@ __meta__ = { } [node name="HSeparator" type="HSeparator" parent="MarginContainer/CenterIcons/VBoxContainer"] -margin_top = 268.0 +margin_top = 508.0 margin_right = 149.0 -margin_bottom = 272.0 +margin_bottom = 512.0 __meta__ = { "_edit_use_anchors_": false } [node name="Start" type="Button" parent="MarginContainer/CenterIcons/VBoxContainer"] -margin_top = 282.0 +margin_top = 522.0 margin_right = 149.0 -margin_bottom = 302.0 +margin_bottom = 542.0 mouse_default_cursor_shape = 2 text = "QUE EMPIENZA" __meta__ = { @@ -87,22 +87,22 @@ __meta__ = { } [node name="Quit" type="Button" parent="MarginContainer/CenterIcons/VBoxContainer"] -margin_top = 312.0 +margin_top = 552.0 margin_right = 149.0 -margin_bottom = 332.0 +margin_bottom = 572.0 mouse_default_cursor_shape = 2 text = "Bueno, si eso luego" [node name="RightIcons" type="HBoxContainer" parent="MarginContainer"] -margin_right = 984.0 -margin_bottom = 560.0 +margin_right = 1880.0 +margin_bottom = 1040.0 mouse_filter = 2 alignment = 2 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/RightIcons"] -margin_left = 984.0 -margin_right = 984.0 -margin_bottom = 560.0 +margin_left = 1880.0 +margin_right = 1880.0 +margin_bottom = 1040.0 mouse_filter = 2 alignment = 2 [connection signal="pressed" from="MarginContainer/LeftIcons/VBoxContainer/OptionsButton" to="." method="_on_OptionsButton_pressed"] diff --git a/real_deal/scripts/duel/DuelCharacter.gd b/real_deal/scripts/duel/DuelCharacter.gd index 8c83d22..a48abf8 100644 --- a/real_deal/scripts/duel/DuelCharacter.gd +++ b/real_deal/scripts/duel/DuelCharacter.gd @@ -10,6 +10,7 @@ var _deck = null var _graveyard = null export var _max_hand_size = 5 export var _draw_amount = 3 +var _healthBar # Estadíscitas básicas export var _health = 10 diff --git a/real_deal/scripts/duel/DuelEnemy.gd b/real_deal/scripts/duel/DuelEnemy.gd index 3dbf987..3102f3a 100644 --- a/real_deal/scripts/duel/DuelEnemy.gd +++ b/real_deal/scripts/duel/DuelEnemy.gd @@ -17,8 +17,15 @@ var skills = [] var loot = [] +var _sprite +var _states + + func _ready(): add_to_group("enemies") + _healthBar = $HealthBarContainer/Container/HealthBar + _sprite = $Character + _states = $StatesContainer/States # Se añaden al grupo de "targetebles" cuando se empieza a usar una carta # para evitar colisiones cuando no debe ## add_to_group("targeteable") @@ -26,18 +33,18 @@ func _ready(): func set_data(enemy_data): self._init_params( enemy_data["deck"], - null, + false, enemy_data["max_hand_size"], enemy_data["max_health"], enemy_data["max_health"], enemy_data["max_energy"], enemy_data["max_energy"] ) - $HealthBar.max_value = enemy_data["max_health"] - $HealthBar.value = $HealthBar.max_value + _healthBar.max_value = enemy_data["max_health"] + _healthBar.value = _healthBar.max_value self.enemy_name = enemy_data["name"] - $Character.frames = load("res://assets/animations/{}.tres".format([enemy_data["animation"]], "{}")) - $Character.animation = "idle" + _sprite.frames = load("res://assets/animations/{}.tres".format([enemy_data["animation"]], "{}")) + _sprite.animation = "idle" self.enemy_class = enemy_data["class"] self.type = enemy_data["type"] self.level = enemy_data["level"] @@ -47,7 +54,7 @@ func set_data(enemy_data): func modify_health(amount): .modify_health(amount) - $HealthBar.value += amount + _healthBar.value += amount func _generate_loot(loot_posibilities): var loot = [] diff --git a/real_deal/scripts/duel/DuelLife.gd b/real_deal/scripts/duel/DuelLife.gd index a50c8de..877bab1 100644 --- a/real_deal/scripts/duel/DuelLife.gd +++ b/real_deal/scripts/duel/DuelLife.gd @@ -2,6 +2,7 @@ con ella como si fuese un elemento más de la escena. """ extends Area2D +#extends MarginContainer # extends "res://real_deal/scripts/duel/DuelCharacter.gd" signal card_target diff --git a/real_deal/scripts/duel/DuelManager.gd b/real_deal/scripts/duel/DuelManager.gd index 5747367..6a426a8 100644 --- a/real_deal/scripts/duel/DuelManager.gd +++ b/real_deal/scripts/duel/DuelManager.gd @@ -19,7 +19,7 @@ var scene_main_menu = "res://real_deal/scenes/menu/MainMenu.tscn" ###### Variables para la mano # Referencia: https://www.youtube.com/watch?v=gUNhn5BJlJ0 -onready var hand_center = get_viewport().get_visible_rect().size * Vector2(0.5, 1.4) +onready var hand_center = get_viewport().get_visible_rect().size * Vector2(0.5, 1.2) onready var h_rad = get_viewport().get_visible_rect().size.x * 0.45 onready var v_rad = get_viewport().get_visible_rect().size.y * 0.4 @@ -74,6 +74,10 @@ func _init_entities(enemy_datas): PlayerManager.max_energy ) + # Conectamos la barra de vida y la inicializamos. Esto habría que sacarlo a una clase propia y refactorizarlo un rato + player._healthBar = $UI_Elements_left/BarConatiner/ProgressBar + player._healthBar.max_value = player._max_health + player._healthBar.value = player._health # TESTING quizás luego es random o algo, yuqse self.turn_sequence.append(player) self.current_turn = player @@ -132,7 +136,7 @@ func place_card(card): self.OvalAngleVector = Vector2(self.h_rad * cos(self.angle), -self.v_rad * sin(self.angle)) card.rect_position = self.hand_center + self.OvalAngleVector - card.rect_size * Vector2(0.25, 0.5) - card.rect_scale = self.card_size/card.rect_size + #card.rect_scale = self.card_size/card.rect_size card.rect_rotation = (90 - rad2deg(self.angle))/4 self.angle += 0.25 diff --git a/real_deal/scripts/duel/DuelPlayer.gd b/real_deal/scripts/duel/DuelPlayer.gd index 71593d2..1225d9b 100644 --- a/real_deal/scripts/duel/DuelPlayer.gd +++ b/real_deal/scripts/duel/DuelPlayer.gd @@ -13,6 +13,9 @@ func _ready(): func play_animation(anim): pass +func modify_health(amount): + .modify_health(amount) + _healthBar.value += amount func _on_Battle_Player_playerAttack(): var bleed = load("res://real_deal/scenes/duel/effects/bleed.tscn").instance()