From 4a090f0d3d40df97aff57b0c5bfb260081c5a820 Mon Sep 17 00:00:00 2001 From: Melon Bread Date: Tue, 14 May 2024 17:56:12 -0400 Subject: [PATCH] Clean up --- scenes/comet.tscn | 56 ++++++++++++++++++++++++++++++++++++++++++++++- scenes/ship.tscn | 1 - scripts/comet.gd | 1 - scripts/ship.gd | 1 - 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/scenes/comet.tscn b/scenes/comet.tscn index fd99888..6acc4d5 100644 --- a/scenes/comet.tscn +++ b/scenes/comet.tscn @@ -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="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"] +[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"] length = 0.001 tracks/0/type = "value" @@ -18,6 +47,18 @@ tracks/0/keys = { "update": 1, "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"] resource_name = "explode" @@ -47,6 +88,18 @@ tracks/1/keys = { "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"] _data = { @@ -60,6 +113,7 @@ collision_mask = 3 script = ExtResource("1_33qxe") [node name="Sprite2D" type="Sprite2D" parent="."] +material = SubResource("ShaderMaterial_6s6e6") texture = ExtResource("1_6q67h") [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] diff --git a/scenes/ship.tscn b/scenes/ship.tscn index cd4e8ae..1066a75 100644 --- a/scenes/ship.tscn +++ b/scenes/ship.tscn @@ -147,7 +147,6 @@ spread = 105.9 gravity = Vector2(0, 0) [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] -visible = false position = Vector2(0, -1) polygon = PackedVector2Array(-3, -31, 4, -31, 32, 28, 32, 33, 28, 33, 1, 16, -24, 33, -32, 33, -32, 27) diff --git a/scripts/comet.gd b/scripts/comet.gd index 8af1200..cf88d13 100644 --- a/scripts/comet.gd +++ b/scripts/comet.gd @@ -52,7 +52,6 @@ func _on_body_entered(body: Node2D) -> void: func _on_area_entered(area: Area2D) -> void: if area.is_in_group("bullet"): area.queue_free() - # TODO: Have some kind of (maybe) particle explosion happen when hit with bullet $AnimationPlayer.play("explode") func explode() -> void: diff --git a/scripts/ship.gd b/scripts/ship.gd index b19ee61..363b814 100644 --- a/scripts/ship.gd +++ b/scripts/ship.gd @@ -63,7 +63,6 @@ func warp() -> void: $WarpCooldown.start() func crash() -> void: - # TODO: Make some kind of crash animation or crashed sprite crashed.emit() $AnimationPlayer.play("crash")