From e186e7f72bfc9b9f53614f9a528b3ce7363d89e8 Mon Sep 17 00:00:00 2001 From: Just Dzhi Date: Mon, 2 Oct 2023 14:26:11 +0400 Subject: [PATCH] change health sprite & player stun --- src/models/player/Player.tscn | 10 ++++- .../player/sprites/player_spriteframes.tres | 24 +++++++++- src/models/player/sprites/stun.png | Bin 0 -> 4582 bytes src/models/player/sprites/stun.png.import | 35 +++++++++++++++ src/models/player/stars/stars.png | Bin 0 -> 4519 bytes src/models/player/stars/stars.png.import | 35 +++++++++++++++ .../player/stars/stars_spriteframes.tres | 27 ++++++++++++ src/scenes/game/Game.tscn | 41 +++++++++++++----- src/scenes/game/game.gd | 2 +- src/scenes/game/sprites/health/health.png | Bin 0 -> 329 bytes .../game/sprites/health/health.png.import | 35 +++++++++++++++ src/scripts/global.gd | 4 +- 12 files changed, 198 insertions(+), 15 deletions(-) create mode 100644 src/models/player/sprites/stun.png create mode 100644 src/models/player/sprites/stun.png.import create mode 100644 src/models/player/stars/stars.png create mode 100644 src/models/player/stars/stars.png.import create mode 100644 src/models/player/stars/stars_spriteframes.tres create mode 100644 src/scenes/game/sprites/health/health.png create mode 100644 src/scenes/game/sprites/health/health.png.import diff --git a/src/models/player/Player.tscn b/src/models/player/Player.tscn index 044a616..982407d 100644 --- a/src/models/player/Player.tscn +++ b/src/models/player/Player.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://src/models/player/sprites/player_spriteframes.tres" type="SpriteFrames" id=1] [ext_resource path="res://src/models/player/player.gd" type="Script" id=2] [ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3] [ext_resource path="res://src/models/shadow/shadow.png" type="Texture" id=4] +[ext_resource path="res://src/models/player/stars/stars_spriteframes.tres" type="SpriteFrames" id=5] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 3.5, 3.5 ) @@ -117,4 +118,11 @@ position = Vector2( 11, 24 ) z_index = -1 texture = ExtResource( 4 ) +[node name="Stars" type="AnimatedSprite" parent="."] +visible = false +position = Vector2( 11, 2 ) +frames = ExtResource( 5 ) +animation = "idle" +playing = true + [connection signal="area_entered" from="EnemyCollision" to="." method="area_entered"] diff --git a/src/models/player/sprites/player_spriteframes.tres b/src/models/player/sprites/player_spriteframes.tres index 05d506d..c6fb721 100644 --- a/src/models/player/sprites/player_spriteframes.tres +++ b/src/models/player/sprites/player_spriteframes.tres @@ -1,6 +1,7 @@ -[gd_resource type="SpriteFrames" load_steps=9 format=2] +[gd_resource type="SpriteFrames" load_steps=14 format=2] [ext_resource path="res://src/models/player/sprites/run.png" type="Texture" id=1] +[ext_resource path="res://src/models/player/sprites/stun.png" type="Texture" id=2] [sub_resource type="AtlasTexture" id=7] atlas = ExtResource( 1 ) @@ -30,6 +31,22 @@ region = Rect2( 88, 0, 22, 25 ) atlas = ExtResource( 1 ) region = Rect2( 110, 0, 22, 25 ) +[sub_resource type="AtlasTexture" id=8] +atlas = ExtResource( 2 ) +region = Rect2( 0, 0, 22, 25 ) + +[sub_resource type="AtlasTexture" id=9] +atlas = ExtResource( 2 ) +region = Rect2( 22, 0, 22, 25 ) + +[sub_resource type="AtlasTexture" id=10] +atlas = ExtResource( 2 ) +region = Rect2( 44, 0, 22, 25 ) + +[sub_resource type="AtlasTexture" id=11] +atlas = ExtResource( 2 ) +region = Rect2( 66, 0, 22, 25 ) + [resource] animations = [ { "frames": [ SubResource( 7 ) ], @@ -41,4 +58,9 @@ animations = [ { "loop": true, "name": "run", "speed": 12.0 +}, { +"frames": [ SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ) ], +"loop": true, +"name": "stun", +"speed": 6.0 } ] diff --git a/src/models/player/sprites/stun.png b/src/models/player/sprites/stun.png new file mode 100644 index 0000000000000000000000000000000000000000..bbae6ecfd8e63d17fab45f78bb0c96b381e15401 GIT binary patch literal 4582 zcmeHLe{dAl9lwZR011px1nQ6VB47i1yZiR{4krW>Or{*f5Fm(DcHh3uE!^E+b~oGs z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=*h=3Qqe_-_02iQ~W6*!_vep8%f^`}Ol5tTV)I z>yMrqJfLp-xt(1{_NqC(sj^w=HzNv%Zkv1}`s|hCYg?NJwfxpPHek!V_@L#>_U{_~ z)tvd;egjS}fBmI`u7_;-)pl*5+MTr4eK zeDblS(+f}cA7X5c7j8Vi$T=oj{U7Mpc=Xh3O`nYZ!RAN%tUh{*S@~@9^c}zdavB$! zIDOpO=hoc!ApK(RrZ*OTIKTQI`|nID19u+P9->;eJT+terLLo1UElJjgYUe2h`W2n z`OA3=ez}9Z{Ks9BkCe51x23dTP0#0gue$g^kK*!B>FWC3%b)3csHoeez2`J_*B6ue zyc=*O62Dg$cDE46k3k|GxW;hUcfvUH!Rz?PopL zoxf}Ec5-^rwM$n+(G~flnxdcPmwo#9(wVPqew~#MY)}qX%v)FY{+_+f>z*94Y01i~ azQDe}ys-A5uh#n~ro41~Nz>>V3;zicdoGFq literal 0 HcmV?d00001 diff --git a/src/models/player/sprites/stun.png.import b/src/models/player/sprites/stun.png.import new file mode 100644 index 0000000..dfd928b --- /dev/null +++ b/src/models/player/sprites/stun.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/stun.png-23b096e8d312acd6a28c91fb8ab5c222.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/models/player/sprites/stun.png" +dest_files=[ "res://.import/stun.png-23b096e8d312acd6a28c91fb8ab5c222.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/models/player/stars/stars.png b/src/models/player/stars/stars.png new file mode 100644 index 0000000000000000000000000000000000000000..c3e149f3b21112f94e5c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#~j@rzmg2API_$WL+0YToM8#&<^!Qzs14ztBR(BapBx1GXhfJS2J!5#;z@I&*^|{3$SDZdP+lYv;&~F! zi5dxL1xgYwteiVD#~Do&fr0(ZC%Oy<*y#PxXJ3={A%%%mCDDD56>zrdoBIq ziOjC2-l#9l@UD1cU~`?Rdw{p@Rh~6`HZ!3%QS@oxPesq$!H1*V;+s%!)yt3>}wtV$U=FqA4kG1{b^$)+@-*oz) z!~5v^{L2s3wch#Xb2;6H^+2#ZtG%V;Z(B23+vhxe=acJSJo>^Th08J)?)m-C|FUyU zNmtVwhX)3BWj2iDUI`5x?me6?f3$XC)t8KWd)BnHZtu8uSNEYyf6cfs@?3Pu^n0^+ z)O_bx)%)h(`t(_A!I9jetKS{C#9-1#zMA{g+r8btNne*evOn$J=u5$@~-_iNbu8#hTzN1U!EvKS$A1xbR zqLt3bS@yun`2;g#FDg*Y8#B?6&rW1 z7#uhuzu>v=;YiC|af-42`Dr=P_sF)z3*~1ocl@L6M~4K>UHt@jm` zXCK}6%PHx7k-LXH#=+G;nLqpPo~0-ER{n0yp8eNeJDAg5eT`bMaq2e~HlCd8{wt+) MRhe&h(faTG8(6y*>Hq)$ literal 0 HcmV?d00001 diff --git a/src/models/player/stars/stars.png.import b/src/models/player/stars/stars.png.import new file mode 100644 index 0000000..d29b3e6 --- /dev/null +++ b/src/models/player/stars/stars.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/stars.png-b2958306b49f2e13efebd45a97e5ffdb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/models/player/stars/stars.png" +dest_files=[ "res://.import/stars.png-b2958306b49f2e13efebd45a97e5ffdb.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/models/player/stars/stars_spriteframes.tres b/src/models/player/stars/stars_spriteframes.tres new file mode 100644 index 0000000..de4d396 --- /dev/null +++ b/src/models/player/stars/stars_spriteframes.tres @@ -0,0 +1,27 @@ +[gd_resource type="SpriteFrames" load_steps=6 format=2] + +[ext_resource path="res://src/models/player/stars/stars.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 22, 12 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 22, 0, 22, 12 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 44, 0, 22, 12 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 1 ) +region = Rect2( 66, 0, 22, 12 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ) ], +"loop": true, +"name": "idle", +"speed": 9.0 +} ] diff --git a/src/scenes/game/Game.tscn b/src/scenes/game/Game.tscn index 69c4210..1de65bd 100644 --- a/src/scenes/game/Game.tscn +++ b/src/scenes/game/Game.tscn @@ -1,14 +1,11 @@ -[gd_scene load_steps=22 format=2] +[gd_scene load_steps=25 format=2] [ext_resource path="res://src/scenes/menu/background/background.png" type="Texture" id=1] [ext_resource path="res://src/scenes/game/sprites/background_houses.png" type="Texture" id=2] [ext_resource path="res://src/scenes/game/spell_holder.gd" type="Script" id=3] [ext_resource path="res://res/themes/8px.tres" type="Theme" id=4] [ext_resource path="res://src/models/player/Player.tscn" type="PackedScene" id=5] -[ext_resource path="res://src/scenes/game/sprites/health/3.png" type="Texture" id=6] -[ext_resource path="res://src/scenes/game/sprites/health/1.png" type="Texture" id=7] -[ext_resource path="res://src/scenes/game/sprites/health/2.png" type="Texture" id=8] -[ext_resource path="res://src/scenes/game/sprites/health/0.png" type="Texture" id=9] +[ext_resource path="res://src/scenes/game/sprites/health/health.png" type="Texture" id=6] [ext_resource path="res://src/scenes/game/sprites/player_icon.png" type="Texture" id=10] [ext_resource path="res://src/scenes/game/game.gd" type="Script" id=11] [ext_resource path="res://src/scenes/game/sprites/ui_background.png" type="Texture" id=12] @@ -23,12 +20,36 @@ extents = Vector2( 10, 60 ) [sub_resource type="RectangleShape2D" id=3] extents = Vector2( 140, 10.125 ) +[sub_resource type="AtlasTexture" id=7] +atlas = ExtResource( 6 ) +region = Rect2( 155, 0, 31, 11 ) + +[sub_resource type="AtlasTexture" id=8] +atlas = ExtResource( 6 ) +region = Rect2( 124, 0, 31, 11 ) + +[sub_resource type="AtlasTexture" id=9] +atlas = ExtResource( 6 ) +region = Rect2( 93, 0, 31, 11 ) + +[sub_resource type="AtlasTexture" id=10] +atlas = ExtResource( 6 ) +region = Rect2( 62, 0, 31, 11 ) + +[sub_resource type="AtlasTexture" id=11] +atlas = ExtResource( 6 ) +region = Rect2( 31, 0, 31, 11 ) + +[sub_resource type="AtlasTexture" id=12] +atlas = ExtResource( 6 ) +region = Rect2( 0, 0, 31, 11 ) + [sub_resource type="SpriteFrames" id=4] animations = [ { -"frames": [ ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 6 ) ], -"loop": true, -"name": "default", -"speed": 5.0 +"frames": [ SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ], +"loop": false, +"name": "idle", +"speed": 0.0 } ] [sub_resource type="Animation" id=5] @@ -162,7 +183,7 @@ margin_bottom = 40.0 [node name="HealthSprite" type="AnimatedSprite" parent="UIWrapper/UI/Left/Health"] position = Vector2( 52, 148 ) frames = SubResource( 4 ) -frame = 3 +animation = "idle" centered = false [node name="PlayerIcon" type="Sprite" parent="UIWrapper/UI/Left"] diff --git a/src/scenes/game/game.gd b/src/scenes/game/game.gd index c6c3895..0966f6a 100644 --- a/src/scenes/game/game.gd +++ b/src/scenes/game/game.gd @@ -14,7 +14,7 @@ var mob_threshold = [5, 7, 10, 7] func _ready(): Global.playing = true Global.play_time = 120 - Global.health = 1 + Global.health = 5 Global.add_health(0) func pause(): diff --git a/src/scenes/game/sprites/health/health.png b/src/scenes/game/sprites/health/health.png new file mode 100644 index 0000000000000000000000000000000000000000..74740b86862ef8e4698ac23b2f0fdd94076592e6 GIT binary patch literal 329 zcmV-P0k-~$P)Px$14%?dRA_N?&kowc^r(rNwd}~vqS#EE6O+F5a)hE z!_Vdp&$nkQ*LqoY$X^H_m`s;afpv@Llp=0yV<%x3f58)MNqtO~YA#NIBWw1b%5A z2V?)~&&{@G)N~7l7JBRkAtYlPTb2E5M~~e&7~9xM*y2L3`|>zIaG