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

@ -3,6 +3,7 @@ extends Node2D
var health = 100.0
func _on_area_2d_area_entered(area: Area2D) -> void:
CurrentGame.change_score(100)
%HurtSound.play()
health -= 0.25
print(%Movements.current_animation)

View file

@ -0,0 +1,32 @@
[gd_scene load_steps=4 format=3 uid="uid://ykg8dydq006a"]
[ext_resource type="Script" uid="uid://bdcxqp8royr5u" path="res://objects/scoreitem/scoreitem_particles.gd" id="1_s0vci"]
[ext_resource type="AudioStream" uid="uid://bv6v7v5dtvoii" path="res://audio/sfx/graze.wav" id="2_55vho"]
[sub_resource type="Gradient" id="Gradient_aeam7"]
offsets = PackedFloat32Array(0, 0.513333, 1)
colors = PackedColorArray(0, 0.647059, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1)
[node name="CPUParticles2D" type="CPUParticles2D"]
emitting = false
amount = 24
lifetime = 0.15
one_shot = true
speed_scale = 0.5
explosiveness = 0.6
randomness = 1.0
lifetime_randomness = 1.0
spread = 154.09
gravity = Vector2(0, 630)
initial_velocity_min = 251.99
initial_velocity_max = 484.86
scale_amount_min = 1.5
scale_amount_max = 2.5
color_ramp = SubResource("Gradient_aeam7")
script = ExtResource("1_s0vci")
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_55vho")
autoplay = true
[connection signal="finished" from="." to="." method="_on_finished"]

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"]