This commit is contained in:
pennyrigate 2025-12-30 19:32:51 -05:00
parent a6421235f8
commit d729c0a7a3
14 changed files with 187 additions and 2 deletions

View file

@ -21,3 +21,14 @@ func _physics_process(delta: float) -> void:
func _on_hurtbox_area_entered(area: Area2D) -> void:
%DeathSound.play()
position = startpos
CurrentGame.change_lives(-1)
if CurrentGame.lives < 0:
gover()
func gover():
print("yeeeowtch!!!")
func _on_graze_box_area_entered(area: Area2D) -> void:
%GrazeParticles.emitting = true
CurrentGame.change_graze(1)

View file

@ -1,10 +1,11 @@
[gd_scene load_steps=11 format=3 uid="uid://c714s5d7d5765"]
[gd_scene load_steps=12 format=3 uid="uid://c714s5d7d5765"]
[ext_resource type="Script" uid="uid://bpo15kuxdmulu" path="res://objects/player/player.gd" id="1_cqmt1"]
[ext_resource type="Texture2D" uid="uid://cre6i8tsdlt7j" path="res://graphics/player/player_1.png" id="2_jnjyq"]
[ext_resource type="Texture2D" uid="uid://cr8jegbgl0wxn" path="res://graphics/player/player_3.png" id="3_gnkmh"]
[ext_resource type="PackedScene" uid="uid://bs0tv5ubqdjp0" path="res://objects/player/bullet_emitter/player_bullet_emitter.tscn" id="3_ssrue"]
[ext_resource type="AudioStream" uid="uid://b3byh6su1b11r" path="res://audio/sounds/se_boom.wav" id="5_gnkmh"]
[ext_resource type="PackedScene" uid="uid://ykg8dydq006a" path="res://objects/graze/graze_particles.tscn" id="6_xkryw"]
[sub_resource type="SpriteFrames" id="SpriteFrames_xkryw"]
animations = [{
@ -30,7 +31,7 @@ size = Vector2(4, 4)
size = Vector2(22, 22)
[sub_resource type="CircleShape2D" id="CircleShape2D_gnkmh"]
radius = 5.0990195
radius = 13.038404
[node name="Player" type="CharacterBody2D"]
collision_layer = 2
@ -69,6 +70,7 @@ shape = SubResource("RectangleShape2D_jnjyq")
[node name="GrazeBox" type="Area2D" parent="."]
position = Vector2(0, -1)
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="GrazeBox"]
shape = SubResource("CircleShape2D_gnkmh")
@ -78,4 +80,13 @@ debug_color = Color(0.7740294, 0.14773864, 0.99999994, 0.41960785)
unique_name_in_owner = true
stream = ExtResource("5_gnkmh")
[node name="GrazeParticles" parent="." instance=ExtResource("6_xkryw")]
unique_name_in_owner = true
amount = 10
scale_amount_min = 1.0
scale_amount_max = 1.0
script = null
[connection signal="area_entered" from="Hurtbox" to="." method="_on_hurtbox_area_entered"]
[connection signal="area_entered" from="GrazeBox" to="." method="_on_graze_box_area_entered"]
[connection signal="finished" from="GrazeParticles" to="." method="_on_cpu_particles_2d_finished"]