This commit is contained in:
Rain Clark 2024-05-14 17:56:12 -04:00
parent 510f80e2fa
commit 4a090f0d3d
4 changed files with 55 additions and 4 deletions

View File

@ -1,9 +1,38 @@
[gd_scene load_steps=7 format=3 uid="uid://bsonrs8vhtly8"] [gd_scene load_steps=13 format=3 uid="uid://bsonrs8vhtly8"]
[ext_resource type="Texture2D" uid="uid://54mfrkbp1kcg" path="res://assets/img/comet.png" id="1_6q67h"] [ext_resource type="Texture2D" uid="uid://54mfrkbp1kcg" path="res://assets/img/comet.png" id="1_6q67h"]
[ext_resource type="Script" path="res://scripts/comet.gd" id="1_33qxe"] [ext_resource type="Script" path="res://scripts/comet.gd" id="1_33qxe"]
[ext_resource type="Shader" path="res://assets/shaders/PixelExplosion.gdshader" id="2_2l5nu"]
[ext_resource type="AudioStream" uid="uid://eb71wdy8dy4x" path="res://assets/sfx/explosion.wav" id="3_awuk4"] [ext_resource type="AudioStream" uid="uid://eb71wdy8dy4x" path="res://assets/sfx/explosion.wav" id="3_awuk4"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_wa814"]
noise_type = 0
seed = 63
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_d4qtj"]
width = 64
height = 64
generate_mipmaps = false
noise = SubResource("FastNoiseLite_wa814")
[sub_resource type="FastNoiseLite" id="FastNoiseLite_s5k64"]
noise_type = 0
seed = 33
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_708n3"]
width = 64
height = 64
generate_mipmaps = false
noise = SubResource("FastNoiseLite_s5k64")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_6s6e6"]
resource_local_to_scene = true
shader = ExtResource("2_2l5nu")
shader_parameter/progress = 0.0
shader_parameter/strength = 1.0
shader_parameter/noise_tex_normal = SubResource("NoiseTexture2D_708n3")
shader_parameter/noise_tex = SubResource("NoiseTexture2D_d4qtj")
[sub_resource type="Animation" id="Animation_8f1wt"] [sub_resource type="Animation" id="Animation_8f1wt"]
length = 0.001 length = 0.001
tracks/0/type = "value" tracks/0/type = "value"
@ -18,6 +47,18 @@ tracks/0/keys = {
"update": 1, "update": 1,
"values": [false] "values": [false]
} }
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprite2D:material:shader_parameter/progress")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_y1taq"] [sub_resource type="Animation" id="Animation_y1taq"]
resource_name = "explode" resource_name = "explode"
@ -47,6 +88,18 @@ tracks/1/keys = {
"method": &"explode" "method": &"explode"
}] }]
} }
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Sprite2D:material:shader_parameter/progress")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2g4hg"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_2g4hg"]
_data = { _data = {
@ -60,6 +113,7 @@ collision_mask = 3
script = ExtResource("1_33qxe") script = ExtResource("1_33qxe")
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_6s6e6")
texture = ExtResource("1_6q67h") texture = ExtResource("1_6q67h")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]

View File

@ -147,7 +147,6 @@ spread = 105.9
gravity = Vector2(0, 0) gravity = Vector2(0, 0)
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
visible = false
position = Vector2(0, -1) position = Vector2(0, -1)
polygon = PackedVector2Array(-3, -31, 4, -31, 32, 28, 32, 33, 28, 33, 1, 16, -24, 33, -32, 33, -32, 27) polygon = PackedVector2Array(-3, -31, 4, -31, 32, 28, 32, 33, 28, 33, 1, 16, -24, 33, -32, 33, -32, 27)

View File

@ -52,7 +52,6 @@ func _on_body_entered(body: Node2D) -> void:
func _on_area_entered(area: Area2D) -> void: func _on_area_entered(area: Area2D) -> void:
if area.is_in_group("bullet"): if area.is_in_group("bullet"):
area.queue_free() area.queue_free()
# TODO: Have some kind of (maybe) particle explosion happen when hit with bullet
$AnimationPlayer.play("explode") $AnimationPlayer.play("explode")
func explode() -> void: func explode() -> void:

View File

@ -63,7 +63,6 @@ func warp() -> void:
$WarpCooldown.start() $WarpCooldown.start()
func crash() -> void: func crash() -> void:
# TODO: Make some kind of crash animation or crashed sprite
crashed.emit() crashed.emit()
$AnimationPlayer.play("crash") $AnimationPlayer.play("crash")