forked from team-sg/hero-mark-2
SPARKLES OMG
This commit is contained in:
parent
3fe77e0052
commit
24e25d6757
7 changed files with 111 additions and 5 deletions
BIN
graphics/particles/shine.png
Normal file
BIN
graphics/particles/shine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 565 B |
35
graphics/particles/shine.png.import
Normal file
35
graphics/particles/shine.png.import
Normal 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
|
|
@ -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://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/key.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://graphics/collectibles/30385.png" type="Texture" id=3]
|
[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://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]
|
[sub_resource type="ShaderMaterial" id=7]
|
||||||
shader = ExtResource( 1 )
|
shader = ExtResource( 1 )
|
||||||
|
@ -62,6 +64,9 @@ animations = [ {
|
||||||
[sub_resource type="RectangleShape2D" id=6]
|
[sub_resource type="RectangleShape2D" id=6]
|
||||||
extents = Vector2( 4, 4 )
|
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"]]
|
[node name="Key" type="Node2D" groups=["gold"]]
|
||||||
pause_mode = 2
|
pause_mode = 2
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
|
@ -71,7 +76,7 @@ material = SubResource( 7 )
|
||||||
position = Vector2( 0, -1 )
|
position = Vector2( 0, -1 )
|
||||||
frames = SubResource( 5 )
|
frames = SubResource( 5 )
|
||||||
animation = "key"
|
animation = "key"
|
||||||
frame = 2
|
frame = 4
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
|
@ -85,4 +90,20 @@ monitorable = false
|
||||||
position = Vector2( 4, 4 )
|
position = Vector2( 4, 4 )
|
||||||
shape = SubResource( 6 )
|
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"]
|
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
||||||
|
|
|
@ -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://shaders/1px_border.gdshader" type="Shader" id=1]
|
||||||
[ext_resource path="res://graphics/collectibles/shard.png" type="Texture" id=2]
|
[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://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]
|
[sub_resource type="ShaderMaterial" id=7]
|
||||||
shader = ExtResource( 1 )
|
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 ) ]
|
"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"]
|
[node name="Shard" type="Node2D"]
|
||||||
pause_mode = 2
|
pause_mode = 2
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
@ -44,10 +49,27 @@ collision_layer = 0
|
||||||
collision_mask = 128
|
collision_mask = 128
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
|
visible = false
|
||||||
position = Vector2( 4.5, 2.5 )
|
position = Vector2( 4.5, 2.5 )
|
||||||
shape = SubResource( 6 )
|
shape = SubResource( 6 )
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
anims/glow = SubResource( 8 )
|
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"]
|
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
||||||
|
|
|
@ -13,6 +13,7 @@ const COLORS = [
|
||||||
|
|
||||||
export(StarColor) var color setget _set_color
|
export(StarColor) var color setget _set_color
|
||||||
export var value = 1
|
export var value = 1
|
||||||
|
export (Array, Color) var particle_colors := []
|
||||||
onready var sprite = $AnimatedSprite
|
onready var sprite = $AnimatedSprite
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
@ -25,6 +26,7 @@ func _set_color(value):
|
||||||
color = value
|
color = value
|
||||||
if is_inside_tree():
|
if is_inside_tree():
|
||||||
sprite.material.set_shader_param("palette", COLORS[color])
|
sprite.material.set_shader_param("palette", COLORS[color])
|
||||||
|
$Sparkles.color = particle_colors[color]
|
||||||
|
|
||||||
func _on_Area2D_body_entered(body):
|
func _on_Area2D_body_entered(body):
|
||||||
#Collect
|
#Collect
|
||||||
|
|
|
@ -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://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://shaders/recolor_border.shader" type="Shader" id=2]
|
||||||
[ext_resource path="res://objects/collectibles/star.gd" type="Script" id=3]
|
[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/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]
|
[sub_resource type="ShaderMaterial" id=10]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
|
@ -47,15 +49,19 @@ animations = [ {
|
||||||
[sub_resource type="RectangleShape2D" id=9]
|
[sub_resource type="RectangleShape2D" id=9]
|
||||||
extents = Vector2( 4, 4 )
|
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"]
|
[node name="Star" type="Node2D"]
|
||||||
pause_mode = 2
|
pause_mode = 2
|
||||||
script = ExtResource( 3 )
|
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="."]
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||||
material = SubResource( 10 )
|
material = SubResource( 10 )
|
||||||
position = Vector2( -1, -3 )
|
position = Vector2( -1, -3 )
|
||||||
frames = SubResource( 8 )
|
frames = SubResource( 8 )
|
||||||
frame = 1
|
frame = 3
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
|
@ -68,4 +74,20 @@ visible = false
|
||||||
position = Vector2( 4, 4 )
|
position = Vector2( 4, 4 )
|
||||||
shape = SubResource( 9 )
|
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"]
|
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
||||||
|
|
4
scripts/randomize_particle_start.gd
Normal file
4
scripts/randomize_particle_start.gd
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
extends CPUParticles2D
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
preprocess = randf() * lifetime
|
Loading…
Add table
Add a link
Reference in a new issue