diff --git a/Assets/Hero/1.png b/Assets/Hero/1.png new file mode 100644 index 00000000..abb07bc1 Binary files /dev/null and b/Assets/Hero/1.png differ diff --git a/Assets/Hero/1.png.import b/Assets/Hero/1.png.import new file mode 100644 index 00000000..ed33c906 --- /dev/null +++ b/Assets/Hero/1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/1.png-d1f6badde5a4c680b0c0135f6558dc2d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Hero/1.png" +dest_files=[ "res://.import/1.png-d1f6badde5a4c680b0c0135f6558dc2d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/Hero/2.png b/Assets/Hero/2.png new file mode 100644 index 00000000..59e6d296 Binary files /dev/null and b/Assets/Hero/2.png differ diff --git a/Assets/Hero/2.png.import b/Assets/Hero/2.png.import new file mode 100644 index 00000000..ce2fdd9a --- /dev/null +++ b/Assets/Hero/2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/2.png-3c0dba2b9818011229c4f89395923310.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Hero/2.png" +dest_files=[ "res://.import/2.png-3c0dba2b9818011229c4f89395923310.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/Hero/Hero0.png b/Assets/Hero/Hero0.png new file mode 100644 index 00000000..88a58c13 Binary files /dev/null and b/Assets/Hero/Hero0.png differ diff --git a/Assets/Hero/Hero0.png.import b/Assets/Hero/Hero0.png.import new file mode 100644 index 00000000..2e5c697f --- /dev/null +++ b/Assets/Hero/Hero0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Hero0.png-3d0c21abfdb9ebfa5095f2e373bc2d4d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Hero/Hero0.png" +dest_files=[ "res://.import/Hero0.png-3d0c21abfdb9ebfa5095f2e373bc2d4d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/Hero/Hero1.png b/Assets/Hero/Hero1.png new file mode 100644 index 00000000..3a4556c1 Binary files /dev/null and b/Assets/Hero/Hero1.png differ diff --git a/Assets/Hero/Hero1.png.import b/Assets/Hero/Hero1.png.import new file mode 100644 index 00000000..75acfe5f --- /dev/null +++ b/Assets/Hero/Hero1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Hero1.png-1f84cb387534816874b7623f2a0ac9d7.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Hero/Hero1.png" +dest_files=[ "res://.import/Hero1.png-1f84cb387534816874b7623f2a0ac9d7.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/Hero/Hero2.png b/Assets/Hero/Hero2.png new file mode 100644 index 00000000..7dec1e2a Binary files /dev/null and b/Assets/Hero/Hero2.png differ diff --git a/Assets/Hero/Hero2.png.import b/Assets/Hero/Hero2.png.import new file mode 100644 index 00000000..0e9e7278 --- /dev/null +++ b/Assets/Hero/Hero2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Hero2.png-acd5ee50d220993f56fbab97dbace207.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Hero/Hero2.png" +dest_files=[ "res://.import/Hero2.png-acd5ee50d220993f56fbab97dbace207.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/Hero/Hero3.png b/Assets/Hero/Hero3.png new file mode 100644 index 00000000..fd444081 Binary files /dev/null and b/Assets/Hero/Hero3.png differ diff --git a/Assets/Hero/Hero3.png.import b/Assets/Hero/Hero3.png.import new file mode 100644 index 00000000..be7d5c0e --- /dev/null +++ b/Assets/Hero/Hero3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Hero3.png-56fdcde37adbf04578b70b51aa48f8d8.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Hero/Hero3.png" +dest_files=[ "res://.import/Hero3.png-56fdcde37adbf04578b70b51aa48f8d8.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Scenes/Actors/Player.gd b/Scenes/Actors/Player.gd index 4ef72720..132fc160 100644 --- a/Scenes/Actors/Player.gd +++ b/Scenes/Actors/Player.gd @@ -25,7 +25,7 @@ var chest = null #Zmienna określająca czy gracz stoi przy skrzyni var level #przypisanie sceny głównej var all_weapons = {} #wszystkie bronki var weapons = {} #posiadane bronki -var current_weapon = 1; +var current_weapon = 1 var first_weapon_stats = {"attack":float(12), "knc":float(0.15)} var second_weapon_stats = {} @@ -59,6 +59,9 @@ var skok = false var skok_vector = Vector2.DOWN var stamina = 3 +# === WYGLAD GRACZA === # +var tekstury = [0, 0, 0] + # === ZMIENNE DO KNOCKBACKU === # var knockback = Vector2.ZERO var knockbackResistance = 1 # rezystancja knockbacku zakres -> (0.6-nieskończoność), poniżej 0.6 przeciwnicy za daleko odlatują @@ -164,7 +167,9 @@ func _ready(): #po inicjacji bohatera "60healthPotion" : 0, "Empty" : 0 } - UpdatePotions() + UpdatePotions() + if Bufor.tekstury != null: + aktulizujSkorki() func _process(delta): @@ -600,3 +605,11 @@ func on_skill_used(ability,mana_used): $CoolDownS3.start(25) else: $CoolDownS4.start(50) + +func aktulizujSkorki(): + if Bufor.tekstury != null: + tekstury = Bufor.tekstury + if tekstury[0] >= 0: + $PlayerSprite.texture = load("res://Assets/Hero/Hero" + str(tekstury[0]) + ".png") + $PlayerSprite/x1.frame = tekstury[1] + $PlayerSprite/x2.frame = tekstury[2] diff --git a/Scenes/Actors/Player.tscn b/Scenes/Actors/Player.tscn index be2bb44f..f7a6c9a0 100644 --- a/Scenes/Actors/Player.tscn +++ b/Scenes/Actors/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=36 format=2] +[gd_scene load_steps=38 format=2] [ext_resource path="res://Assets/Hero/RedHero.png" type="Texture" id=1] [ext_resource path="res://Scenes/Actors/Player.gd" type="Script" id=2] @@ -7,6 +7,8 @@ [ext_resource path="res://Scenes/title_screen/music/projekt_8bit.ogg" type="AudioStream" id=5] [ext_resource path="res://Assets/Enemies/shadow.png" type="Texture" id=6] [ext_resource path="res://Assets/Light/Light.tscn" type="PackedScene" id=7] +[ext_resource path="res://Assets/Hero/1.png" type="Texture" id=8] +[ext_resource path="res://Assets/Hero/2.png" type="Texture" id=9] [sub_resource type="Gradient" id=1] offsets = PoolRealArray( 0, 0.794702, 1 ) @@ -102,6 +104,18 @@ tracks/0/keys = { "update": 1, "values": [ 1, 2, 3, 4, 5, 6, 7 ] } +tracks/1/type = "value" +tracks/1/path = NodePath("PlayerSprite/x1:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ Vector2( 0, 0 ), Vector2( 0, 1 ), Vector2( 0, 0 ), Vector2( 0, -1 ), Vector2( 0, -2 ), Vector2( 0, -1 ), Vector2( 0, 0 ) ] +} [sub_resource type="Animation" id=14] resource_name = "skok" @@ -192,7 +206,9 @@ color_ramp = SubResource( 24 ) [sub_resource type="OccluderPolygon2D" id=28] polygon = PoolVector2Array( -5, -4, 5, -4, 5, 9, -5, 9 ) -[node name="Player" type="KinematicBody2D" groups=["Player"]] +[node name="Player" type="KinematicBody2D" groups=[ +"Player", +]] collision_mask = 6 script = ExtResource( 2 ) @@ -214,7 +230,16 @@ position = Vector2( 0, -4 ) scale = Vector2( 1.5, 1.5 ) texture = ExtResource( 1 ) hframes = 9 -frame = 8 +frame = 7 + +[node name="x1" type="Sprite" parent="PlayerSprite"] +texture = ExtResource( 8 ) +hframes = 3 + +[node name="x2" type="Sprite" parent="PlayerSprite"] +show_behind_parent = true +texture = ExtResource( 9 ) +hframes = 3 [node name="PlayerCollision" type="CollisionShape2D" parent="."] position = Vector2( 0, 7.109 ) diff --git a/Scenes/Levels/Spawning_enemies.gd b/Scenes/Levels/Spawning_enemies.gd index ddc26df4..d173cdd6 100644 --- a/Scenes/Levels/Spawning_enemies.gd +++ b/Scenes/Levels/Spawning_enemies.gd @@ -101,22 +101,6 @@ func _on_Node2D_body_entered(body): #Funkcja,która się aktywuje po wejsciu w k call_deferred("add_child",bossIns) #dodawanie sceny boss'a bossIns.connect("died", self, "open") #polaczenie sygnalu ktory otwiera drzwi po zabiciu bossa close_door() #zamkniecie drzwi - elif is_sklep: - if odwiedzony == false: - weapon() - potion() - var popup = load("res://Scenes/UI/Sklep_ceny.tscn") - popup = popup.instance() - popup.rect_scale.x = 0.5 - popup.rect_scale.y = 0.5 - call_deferred("add_child", popup) - popups[body] = popup - odwiedzony = true - Bufor.in_sklep = true - elif is_sklep == false: - if body in popups: - popups[body].call_deferred('free') - Bufor.in_sklep = false id_list.append(current_id) if body.is_in_group("Enemy"): #zamykanie drzwi po wejsciu do pokoju close_door() diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index 6acbf9c1..8a823dba 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -15,7 +15,7 @@ [ext_resource path="res://Scenes/Actors/OctoBoss/octo3.png" type="Texture" id=13] [ext_resource path="res://Scenes/title_screen/MenuLights.gd" type="Script" id=14] -[sub_resource type="SpriteFrames" id=2] +[sub_resource type="SpriteFrames" id=1] animations = [ { "frames": [ ExtResource( 9 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 13 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 12 ), ExtResource( 9 ), ExtResource( 9 ) ], "loop": true, @@ -23,27 +23,27 @@ animations = [ { "speed": 2.0 } ] -[sub_resource type="AtlasTexture" id=3] +[sub_resource type="AtlasTexture" id=2] atlas = ExtResource( 11 ) region = Rect2( 0, 0, 46, 56 ) -[sub_resource type="AtlasTexture" id=4] +[sub_resource type="AtlasTexture" id=3] atlas = ExtResource( 11 ) region = Rect2( 0, 56, 46, 56 ) -[sub_resource type="AtlasTexture" id=5] +[sub_resource type="AtlasTexture" id=4] atlas = ExtResource( 11 ) region = Rect2( 0, 112, 46, 56 ) -[sub_resource type="SpriteFrames" id=6] +[sub_resource type="SpriteFrames" id=5] animations = [ { -"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 3 ), SubResource( 4 ), SubResource( 4 ), SubResource( 4 ), SubResource( 3 ), SubResource( 4 ), SubResource( 3 ), SubResource( 5 ), SubResource( 3 ), SubResource( 3 ), SubResource( 3 ), SubResource( 3 ) ], +"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 2 ), SubResource( 3 ), SubResource( 3 ), SubResource( 3 ), SubResource( 2 ), SubResource( 3 ), SubResource( 2 ), SubResource( 4 ), SubResource( 2 ), SubResource( 2 ), SubResource( 2 ), SubResource( 2 ) ], "loop": true, "name": "pandoboss_menu", "speed": 2.0 } ] -[sub_resource type="DynamicFont" id=1] +[sub_resource type="DynamicFont" id=6] font_data = ExtResource( 5 ) [node name="TitleScreen" type="Control"] @@ -74,9 +74,9 @@ __meta__ = { modulate = Color( 0.160784, 0.12549, 0.12549, 0.588235 ) position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) -frames = SubResource( 2 ) +frames = SubResource( 1 ) animation = "octoboss_menu" -frame = 5 +frame = 12 playing = true flip_h = true @@ -84,9 +84,9 @@ flip_h = true modulate = Color( 0.160784, 0.12549, 0.12549, 0.588235 ) position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) -frames = SubResource( 6 ) +frames = SubResource( 5 ) animation = "pandoboss_menu" -frame = 2 +frame = 4 playing = true [node name="Menu" type="VBoxContainer" parent="."] @@ -138,7 +138,7 @@ scene_to_load = "res://Scenes/title_screen/game/ExitScene.tscn" margin_top = 640.0 margin_right = 699.0 margin_bottom = 685.0 -custom_fonts/font = SubResource( 1 ) +custom_fonts/font = SubResource( 6 ) text = "Version v0.2.1 By SKNI KOD" @@ -234,4 +234,14 @@ position = Vector2( 649.631, 193.124 ) rotation = 3.14159 region_rect = Rect2( 32, 42, 19, 14 ) +[node name="custom" type="Button" parent="."] +margin_left = 1211.82 +margin_top = 16.8725 +margin_right = 1259.82 +margin_bottom = 64.8725 +__meta__ = { +"_edit_use_anchors_": false +} + [connection signal="fade_finished" from="FadeIn" to="." method="_on_FadeIn_fade_finished"] +[connection signal="pressed" from="custom" to="." method="_on_custom_pressed"] diff --git a/Scenes/title_screen/custom/custom.gd b/Scenes/title_screen/custom/custom.gd new file mode 100644 index 00000000..8731955d --- /dev/null +++ b/Scenes/title_screen/custom/custom.gd @@ -0,0 +1,29 @@ +extends Node2D + +func gotowe(): + var skorka = 0 + var peleryna = 0 + var akcesoria = 0 + if $skorki/wybor.get_selected_items().size() > 0: + skorka = $skorki/wybor.get_selected_items()[0]-1 + if $peleryny/wybor.get_selected_items().size() > 0: + peleryna = $peleryny/wybor.get_selected_items()[0] + if $akcesoria/wybor.get_selected_items().size() > 0: + akcesoria = $akcesoria/wybor.get_selected_items()[0] + Bufor.tekstury = [skorka,akcesoria,peleryna] + get_tree().change_scene_to(load("res://Scenes/title_screen/TitleScreen.tscn")) + + +func wybranaPeleryna(index): + $manekin/peleryna.frame = index + + +func wybranaSkorka(index): + if index > 0: + $manekin.texture = load("res://Assets/Hero/Hero" + str(index-1) + ".png") + else: + $manekin.texture = load("res://Assets/Hero/RedHero.png") + + +func wybraneAkcesoria(index): + $manekin/akcesoria.frame = index diff --git a/Scenes/title_screen/custom/custom.tscn b/Scenes/title_screen/custom/custom.tscn new file mode 100644 index 00000000..a5fb9349 --- /dev/null +++ b/Scenes/title_screen/custom/custom.tscn @@ -0,0 +1,84 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://icon.png" type="Texture" id=1] +[ext_resource path="res://Scenes/title_screen/custom/custom.gd" type="Script" id=2] +[ext_resource path="res://Assets/Hero/RedHero.png" type="Texture" id=3] +[ext_resource path="res://Assets/Hero/2.png" type="Texture" id=4] +[ext_resource path="res://Assets/Hero/1.png" type="Texture" id=5] + +[node name="custom" type="Node2D"] +z_index = 16 +script = ExtResource( 2 ) + +[node name="peleryny" type="Node2D" parent="."] +position = Vector2( 0, 232 ) + +[node name="wybor" type="ItemList" parent="peleryny"] +margin_left = 16.0 +margin_top = 24.0 +margin_right = 768.0 +margin_bottom = 240.0 +items = [ "", ExtResource( 1 ), false, "", ExtResource( 1 ), false, "", ExtResource( 1 ), false, "", ExtResource( 1 ), false ] +allow_reselect = true +max_columns = 5 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="skorki" type="Node2D" parent="."] + +[node name="wybor" type="ItemList" parent="skorki"] +margin_left = 16.0 +margin_top = 24.0 +margin_right = 1264.0 +margin_bottom = 240.0 +items = [ "", ExtResource( 1 ), false, "", ExtResource( 1 ), false, "", ExtResource( 1 ), false, "", ExtResource( 1 ), false ] +allow_reselect = true +max_columns = 5 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="akcesoria" type="Node2D" parent="."] +position = Vector2( 0, 464 ) + +[node name="wybor" type="ItemList" parent="akcesoria"] +margin_left = 16.0 +margin_top = 24.0 +margin_right = 768.0 +margin_bottom = 240.0 +items = [ "", ExtResource( 1 ), false, "", ExtResource( 1 ), false, "", ExtResource( 1 ), false, "", ExtResource( 1 ), false ] +allow_reselect = true +max_columns = 5 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="gotowe" type="Button" parent="."] +margin_left = 1024.0 +margin_top = 672.0 +margin_right = 1036.0 +margin_bottom = 692.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="manekin" type="Sprite" parent="."] +position = Vector2( 1040, 440 ) +scale = Vector2( 16, 16 ) +texture = ExtResource( 3 ) +hframes = 9 + +[node name="peleryna" type="Sprite" parent="manekin"] +show_behind_parent = true +texture = ExtResource( 4 ) +hframes = 3 + +[node name="akcesoria" type="Sprite" parent="manekin"] +texture = ExtResource( 5 ) +hframes = 3 + +[connection signal="item_selected" from="peleryny/wybor" to="." method="wybranaPeleryna"] +[connection signal="item_selected" from="skorki/wybor" to="." method="wybranaSkorka"] +[connection signal="item_selected" from="akcesoria/wybor" to="." method="wybraneAkcesoria"] +[connection signal="pressed" from="gotowe" to="." method="gotowe"] diff --git a/Scenes/title_screen/title_screen.gd b/Scenes/title_screen/title_screen.gd index 91c5e75c..6347e96d 100644 --- a/Scenes/title_screen/title_screen.gd +++ b/Scenes/title_screen/title_screen.gd @@ -16,4 +16,5 @@ func _on_Button_pressed(scene_to_load):#dodaje animację przyciemniania przy prz func _on_FadeIn_fade_finished():#przechodzi do wybranej sceny get_tree().change_scene(scene_path_to_load) - +func _on_custom_pressed(): + get_tree().change_scene_to(load("res://Scenes/title_screen/custom/custom.tscn")) diff --git a/autoloads/bufor.gd b/autoloads/bufor.gd index 677634e6..569db4e8 100644 --- a/autoloads/bufor.gd +++ b/autoloads/bufor.gd @@ -11,3 +11,6 @@ var second_weapon_stats = null var equipped = null var potions = null var potions_amount = null + +# przechowuje informacje o wyglądzie gracza +var tekstury = [0, 0, 0]