1
- [gd_scene load_steps =73 format =3 uid ="uid://bsfyypyhwfbs5" ]
1
+ [gd_scene load_steps =82 format =3 uid ="uid://bsfyypyhwfbs5" ]
2
2
3
3
[ext_resource type ="PackedScene" uid ="uid://du0c1yciw8ul6" path ="res://objects/actors/Actor.tscn" id ="1_wrkhm" ]
4
4
[ext_resource type ="Script" path ="res://objects/actors/player/Player.gd" id ="2_bhjnv" ]
5
+ [ext_resource type ="Shader" path ="res://objects/actors/player/DamageFlash.gdshader" id ="2_outsh" ]
5
6
[ext_resource type ="Resource" uid ="uid://r3i80a6v2w0y" path ="res://resources/weapons/gun/Gun.tres" id ="3_irbyu" ]
6
7
[ext_resource type ="Texture2D" uid ="uid://dw5vuo3agm77m" path ="res://objects/actors/player/template.png" id ="3_q5uec" ]
7
8
[ext_resource type ="PackedScene" uid ="uid://cxlkjx4h6gv5h" path ="res://components/collector/Collector.tscn" id ="5_q1uwo" ]
9
+ [ext_resource type ="Script" path ="res://objects/actors/player/HealthBar.gd" id ="7_ot68h" ]
8
10
9
11
[sub_resource type ="SceneReplicationConfig" id ="SceneReplicationConfig_p4sxr" ]
10
12
properties/0/path = NodePath (".:position" )
11
13
properties/0/spawn = true
12
14
properties/0/replication_mode = 1
13
15
16
+ [sub_resource type ="ShaderMaterial" id ="ShaderMaterial_6m6gk" ]
17
+ shader = ExtResource ("2_outsh" )
18
+ shader_parameter/flash_color = Color (0.576083 , 0 , 0.000370174 , 1 )
19
+ shader_parameter/flash_value = 0.0
20
+
14
21
[sub_resource type ="AtlasTexture" id ="AtlasTexture_p8sqi" ]
15
22
atlas = ExtResource ("3_q5uec" )
16
23
region = Rect2 (0 , 0 , 64 , 64 )
@@ -508,19 +515,48 @@ radius = 32.0
508
515
[sub_resource type ="CircleShape2D" id ="CircleShape2D_xu8dn" ]
509
516
radius = 80.0
510
517
511
- [sub_resource type ="Animation" id ="Animation_tc2ku " ]
512
- length = 0.001
518
+ [sub_resource type ="Animation" id ="Animation_0v3ge " ]
519
+ resource_name = "Death"
513
520
tracks/0/type = "value"
514
521
tracks/0/imported = false
515
522
tracks/0/enabled = true
516
523
tracks/0/path = NodePath (".:modulate" )
517
524
tracks/0/interp = 1
518
525
tracks/0/loop_wrap = true
519
526
tracks/0/keys = {
520
- "times" : PackedFloat32Array (0 ),
521
- "transitions" : PackedFloat32Array (1 ),
527
+ "times" : PackedFloat32Array (0 , 0.75 ),
528
+ "transitions" : PackedFloat32Array (1 , 1 ),
522
529
"update" : 0 ,
523
- "values" : [Color (1 , 1 , 1 , 1 )]
530
+ "values" : [Color (1 , 1 , 1 , 1 ), Color (1 , 1 , 1 , 0 )]
531
+ }
532
+ tracks/1/type = "method"
533
+ tracks/1/imported = false
534
+ tracks/1/enabled = true
535
+ tracks/1/path = NodePath ("." )
536
+ tracks/1/interp = 1
537
+ tracks/1/loop_wrap = true
538
+ tracks/1/keys = {
539
+ "times" : PackedFloat32Array (0.75 ),
540
+ "transitions" : PackedFloat32Array (1 ),
541
+ "values" : [{
542
+ "args" : [],
543
+ "method" : &"queue_free"
544
+ }]
545
+ }
546
+
547
+ [sub_resource type ="Animation" id ="Animation_fx0oj" ]
548
+ resource_name = "Hit"
549
+ length = 0.4
550
+ tracks/0/type = "bezier"
551
+ tracks/0/imported = false
552
+ tracks/0/enabled = true
553
+ tracks/0/path = NodePath ("AnimatedSprite:material:shader_parameter/flash_value" )
554
+ tracks/0/interp = 1
555
+ tracks/0/loop_wrap = true
556
+ tracks/0/keys = {
557
+ "handle_modes" : PackedInt32Array (0 , 0 , 0 ),
558
+ "points" : PackedFloat32Array (0 , -0.2 , 0 , 0.2 , 0 , 1 , -0.2 , 0 , 0.2 , 0 , 0 , -0.2 , 0 , 0.2 , 0 ),
559
+ "times" : PackedFloat32Array (0 , 0.2 , 0.4 )
524
560
}
525
561
526
562
[sub_resource type ="Animation" id ="Animation_l1t87" ]
@@ -552,22 +588,52 @@ tracks/1/keys = {
552
588
}]
553
589
}
554
590
591
+ [sub_resource type ="Animation" id ="Animation_tc2ku" ]
592
+ length = 0.001
593
+ tracks/0/type = "value"
594
+ tracks/0/imported = false
595
+ tracks/0/enabled = true
596
+ tracks/0/path = NodePath (".:modulate" )
597
+ tracks/0/interp = 1
598
+ tracks/0/loop_wrap = true
599
+ tracks/0/keys = {
600
+ "times" : PackedFloat32Array (0 ),
601
+ "transitions" : PackedFloat32Array (1 ),
602
+ "update" : 0 ,
603
+ "values" : [Color (1 , 1 , 1 , 1 )]
604
+ }
605
+ tracks/1/type = "bezier"
606
+ tracks/1/imported = false
607
+ tracks/1/enabled = true
608
+ tracks/1/path = NodePath (".:material:shader_parameter/flash_value" )
609
+ tracks/1/interp = 1
610
+ tracks/1/loop_wrap = true
611
+ tracks/1/keys = {
612
+ "handle_modes" : PackedInt32Array (0 ),
613
+ "points" : PackedFloat32Array (0 , -0.25 , 0 , 0.25 , 0 ),
614
+ "times" : PackedFloat32Array (0 )
615
+ }
616
+
555
617
[sub_resource type ="AnimationLibrary" id ="AnimationLibrary_mt86f" ]
556
618
_data = {
557
- "RESET" : SubResource ("Animation_tc2ku" ),
558
- "fade_away" : SubResource ("Animation_l1t87" )
619
+ "Death" : SubResource ("Animation_0v3ge" ),
620
+ "FadeAway" : SubResource ("Animation_l1t87" ),
621
+ "Hit" : SubResource ("Animation_fx0oj" ),
622
+ "RESET" : SubResource ("Animation_tc2ku" )
559
623
}
560
624
561
625
[node name ="Player" instance =ExtResource ("1_wrkhm" )]
562
626
collision_mask = 7
563
627
script = ExtResource ("2_bhjnv" )
564
628
chestModifierSpeed = 0.7
629
+ maxHealth = 100
565
630
weapon = ExtResource ("3_irbyu" )
566
631
567
632
[node name ="MultiplayerSynchronizer" type ="MultiplayerSynchronizer" parent ="." index ="0" ]
568
633
replication_config = SubResource ("SceneReplicationConfig_p4sxr" )
569
634
570
635
[node name ="AnimatedSprite" parent ="." index ="1" ]
636
+ material = SubResource ("ShaderMaterial_6m6gk" )
571
637
sprite_frames = SubResource ("SpriteFrames_67jtf" )
572
638
animation = &"IdleRight"
573
639
autoplay = "IdleDown"
@@ -590,4 +656,17 @@ libraries = {
590
656
"" : SubResource ("AnimationLibrary_mt86f" )
591
657
}
592
658
659
+ [node name ="HealthBar" type ="ProgressBar" parent ="." index ="6" ]
660
+ modulate = Color (0.227451 , 0.768627 , 0.156863 , 1 )
661
+ z_index = 10
662
+ offset_left = -68.0
663
+ offset_top = -60.0
664
+ offset_right = 206.0
665
+ offset_bottom = -33.0
666
+ scale = Vector2 (0.5 , 0.5 )
667
+ mouse_filter = 2
668
+ step = 1.0
669
+ show_percentage = false
670
+ script = ExtResource ("7_ot68h" )
671
+
593
672
[connection signal ="on_collecting" from ="Collector" to ="." method ="_on_collecting" ]
0 commit comments