SPARKLES OMG

This commit is contained in:
Haze Weathers 2023-11-29 20:11:23 -05:00
parent 3fe77e0052
commit 24e25d6757
7 changed files with 111 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/shine.png-e490d9bf1bcf9743c95719a78e9f033e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/particles/shine.png"
dest_files=[ "res://.import/shine.png-e490d9bf1bcf9743c95719a78e9f033e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,11 @@
[gd_scene load_steps=17 format=2]
[gd_scene load_steps=20 format=2]
[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1]
[ext_resource path="res://graphics/collectibles/key.png" type="Texture" id=2]
[ext_resource path="res://graphics/collectibles/30385.png" type="Texture" id=3]
[ext_resource path="res://objects/collectibles/key.gd" type="Script" id=4]
[ext_resource path="res://graphics/particles/shine.png" type="Texture" id=5]
[ext_resource path="res://scripts/randomize_particle_start.gd" type="Script" id=6]
[sub_resource type="ShaderMaterial" id=7]
shader = ExtResource( 1 )
@ -62,6 +64,9 @@ animations = [ {
[sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 4, 4 )
[sub_resource type="Curve" id=17]
_data = [ Vector2( 0, 0 ), 0.0, 0.100639, 0, 0, Vector2( 0.25, 1 ), 7.51724, -6.83592, 0, 0, Vector2( 0.5, 0 ), 0.0, 0.0, 0, 0 ]
[node name="Key" type="Node2D" groups=["gold"]]
pause_mode = 2
script = ExtResource( 4 )
@ -71,7 +76,7 @@ material = SubResource( 7 )
position = Vector2( 0, -1 )
frames = SubResource( 5 )
animation = "key"
frame = 2
frame = 4
playing = true
centered = false
@ -85,4 +90,20 @@ monitorable = false
position = Vector2( 4, 4 )
shape = SubResource( 6 )
[node name="Sparkles" type="CPUParticles2D" parent="."]
position = Vector2( 4.5, 4 )
amount = 1
lifetime = 1.5
texture = ExtResource( 5 )
emission_shape = 2
emission_rect_extents = Vector2( 4, 4 )
gravity = Vector2( 0, 0 )
angular_velocity = 720.0
angular_velocity_random = 1.0
angle = 720.0
angle_random = 1.0
scale_amount_curve = SubResource( 17 )
color = Color( 0.996078, 1, 0.760784, 1 )
script = ExtResource( 6 )
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]

View file

@ -1,8 +1,10 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=10 format=2]
[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1]
[ext_resource path="res://graphics/collectibles/shard.png" type="Texture" id=2]
[ext_resource path="res://objects/collectibles/shard.gd" type="Script" id=3]
[ext_resource path="res://graphics/particles/shine.png" type="Texture" id=4]
[ext_resource path="res://scripts/randomize_particle_start.gd" type="Script" id=5]
[sub_resource type="ShaderMaterial" id=7]
shader = ExtResource( 1 )
@ -29,6 +31,9 @@ tracks/0/keys = {
"values": [ Color( 0.329412, 0.360784, 0.847059, 1 ), Color( 1, 1, 1, 1 ), Color( 0.329412, 0.360784, 0.847059, 1 ) ]
}
[sub_resource type="Curve" id=9]
_data = [ Vector2( 0, 0 ), 0.0, 0.100639, 0, 0, Vector2( 0.25, 1 ), 7.51724, -6.83592, 0, 0, Vector2( 0.5, 0 ), 0.0, 0.0, 0, 0 ]
[node name="Shard" type="Node2D"]
pause_mode = 2
script = ExtResource( 3 )
@ -44,10 +49,27 @@ collision_layer = 0
collision_mask = 128
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
visible = false
position = Vector2( 4.5, 2.5 )
shape = SubResource( 6 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/glow = SubResource( 8 )
[node name="Sparkles" type="CPUParticles2D" parent="."]
position = Vector2( 4.5, 2.5 )
amount = 1
lifetime = 1.5
texture = ExtResource( 4 )
emission_shape = 2
emission_rect_extents = Vector2( 5, 5 )
gravity = Vector2( 0, 0 )
angular_velocity = 720.0
angular_velocity_random = 1.0
angle = 720.0
angle_random = 1.0
scale_amount_curve = SubResource( 9 )
color = Color( 0.72549, 0.956863, 1, 1 )
script = ExtResource( 5 )
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]

View file

@ -13,6 +13,7 @@ const COLORS = [
export(StarColor) var color setget _set_color
export var value = 1
export (Array, Color) var particle_colors := []
onready var sprite = $AnimatedSprite
func _ready():
@ -25,6 +26,7 @@ func _set_color(value):
color = value
if is_inside_tree():
sprite.material.set_shader_param("palette", COLORS[color])
$Sparkles.color = particle_colors[color]
func _on_Area2D_body_entered(body):
#Collect

View file

@ -1,9 +1,11 @@
[gd_scene load_steps=14 format=2]
[gd_scene load_steps=17 format=2]
[ext_resource path="res://graphics/collectibles/pal_star_red.png" type="Texture" id=1]
[ext_resource path="res://shaders/recolor_border.shader" type="Shader" id=2]
[ext_resource path="res://objects/collectibles/star.gd" type="Script" id=3]
[ext_resource path="res://graphics/collectibles/star.png" type="Texture" id=4]
[ext_resource path="res://graphics/particles/shine.png" type="Texture" id=5]
[ext_resource path="res://scripts/randomize_particle_start.gd" type="Script" id=6]
[sub_resource type="ShaderMaterial" id=10]
resource_local_to_scene = true
@ -47,15 +49,19 @@ animations = [ {
[sub_resource type="RectangleShape2D" id=9]
extents = Vector2( 4, 4 )
[sub_resource type="Curve" id=17]
_data = [ Vector2( 0, 0 ), 0.0, 0.100639, 0, 0, Vector2( 0.25, 1 ), 7.51724, -6.83592, 0, 0, Vector2( 0.5, 0 ), 0.0, 0.0, 0, 0 ]
[node name="Star" type="Node2D"]
pause_mode = 2
script = ExtResource( 3 )
particle_colors = [ Color( 1, 0.741176, 0.709804, 1 ), Color( 1, 0.968627, 0.709804, 1 ), Color( 0.709804, 1, 0.74902, 1 ), Color( 0.709804, 0.752941, 1, 1 ), Color( 1, 0.709804, 0.984314, 1 ) ]
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
material = SubResource( 10 )
position = Vector2( -1, -3 )
frames = SubResource( 8 )
frame = 1
frame = 3
playing = true
centered = false
@ -68,4 +74,20 @@ visible = false
position = Vector2( 4, 4 )
shape = SubResource( 9 )
[node name="Sparkles" type="CPUParticles2D" parent="."]
position = Vector2( 4.5, 4 )
amount = 1
lifetime = 1.5
texture = ExtResource( 5 )
emission_shape = 2
emission_rect_extents = Vector2( 4, 4 )
gravity = Vector2( 0, 0 )
angular_velocity = 720.0
angular_velocity_random = 1.0
angle = 720.0
angle_random = 1.0
scale_amount_curve = SubResource( 17 )
color = Color( 1, 0.741176, 0.709804, 1 )
script = ExtResource( 6 )
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]

View file

@ -0,0 +1,4 @@
extends CPUParticles2D
func _ready() -> void:
preprocess = randf() * lifetime