added cool animations

This commit is contained in:
zoe 2021-10-09 18:50:01 +02:00
parent 77ca16be36
commit 6cb03fda72
41 changed files with 569 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/ScattershoPortalt.png-2ae7ac0cfd70b69cd8ba914119d8fce0.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Pegs/Yellow/Powerups/Scattershot/ScattershoPortalt.png"
dest_files=[ "res://.import/ScattershoPortalt.png-2ae7ac0cfd70b69cd8ba914119d8fce0.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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Scattershot-Sheet.png-ecf161ac3d7600c6a9125b1338a0303f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Pegs/Yellow/Powerups/Scattershot/Scattershot-Sheet.png"
dest_files=[ "res://.import/Scattershot-Sheet.png-ecf161ac3d7600c6a9125b1338a0303f.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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View file

@ -0,0 +1,39 @@
extends Node2D
var appeared = false
export var ball_number = 16
func _ready() -> void:
$AnimatedSprite.frame = 0
$AnimatedSprite.play("appear")
$Particles2D.emitting = true
func set_time_scale():
Engine.time_scale = 1
func _on_AnimatedSprite_animation_finished() -> void:
if appeared:
queue_free()
else:
appeared = true
$AnimatedSprite.play("disappear")
spawn_balls()
func spawn_balls():
if GameStats.camera_fx:
Engine.time_scale = 0.25
$SlowmoTimer.start()
var i = 0
while i < ball_number:
var Ball = preload("res://Pegs/Yellow/Powerups/Scattershot/ScattershotBall.tscn")
var ball = Ball.instance()
var main = get_tree().current_scene
ball.global_position = global_position
main.add_child(ball)
i += 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Scattershot.png-615948268c9a5cf2e66afee78c3b708b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Pegs/Yellow/Powerups/Scattershot/Scattershot.png"
dest_files=[ "res://.import/Scattershot.png-615948268c9a5cf2e66afee78c3b708b.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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View file

@ -0,0 +1,102 @@
[gd_scene load_steps=17 format=2]
[ext_resource path="res://Pegs/Yellow/Powerups/Scattershot/Scattershot.gd" type="Script" id=1]
[ext_resource path="res://Pegs/Yellow/Powerups/Scattershot/ScattershoPortalt.png" type="Texture" id=2]
[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 2 )
region = Rect2( 160, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 2 )
region = Rect2( 128, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 2 )
region = Rect2( 96, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 2 )
region = Rect2( 64, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 2 )
region = Rect2( 32, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 2 )
region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 2 )
region = Rect2( 0, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 2 )
region = Rect2( 32, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 2 )
region = Rect2( 64, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 2 )
region = Rect2( 96, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=18]
atlas = ExtResource( 2 )
region = Rect2( 128, 0, 32, 32 )
[sub_resource type="AtlasTexture" id=19]
atlas = ExtResource( 2 )
region = Rect2( 160, 0, 32, 32 )
[sub_resource type="SpriteFrames" id=20]
animations = [ {
"frames": [ SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ) ],
"loop": true,
"name": "appear",
"speed": 15.0
}, {
"frames": [ SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ) ],
"loop": false,
"name": "disappear",
"speed": 15.0
} ]
[sub_resource type="ParticlesMaterial" id=21]
emission_shape = 1
emission_sphere_radius = 16.0
flag_disable_z = true
direction = Vector3( 1, 10, 0 )
spread = 180.0
gravity = Vector3( 0, 100, 0 )
initial_velocity = 60.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
color = Color( 0.454902, 0.337255, 0.607843, 1 )
[node name="Scattershot" type="Node2D"]
script = ExtResource( 1 )
[node name="SlowmoTimer" type="Timer" parent="."]
wait_time = 0.25
one_shot = true
autostart = true
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
z_index = -15
frames = SubResource( 20 )
animation = "appear"
[node name="Particles2D" type="Particles2D" parent="."]
z_index = -20
emitting = false
amount = 64
lifetime = 3.0
one_shot = true
explosiveness = 1.0
process_material = SubResource( 21 )
[connection signal="timeout" from="SlowmoTimer" to="." method="set_time_scale"]
[connection signal="animation_finished" from="AnimatedSprite" to="." method="_on_AnimatedSprite_animation_finished"]

View file

@ -0,0 +1,41 @@
extends RigidBody2D
var can_be_deleted = false setget set_can_be_deleted, get_can_be_deleted
func _ready() -> void:
var x_impulse = rand_range(-150, 150)
var y_impulse = rand_range(-150, 150)
var impulse_vector = Vector2(x_impulse, y_impulse)
apply_central_impulse(Vector2(impulse_vector))
func _physics_process(_delta):
var collider_array = get_colliding_bodies()
for collider in collider_array:
set_particle_direction(collider)
turn_pegs_green(collider)
func turn_pegs_green(collider):
# check if pegs can be turned green
if (collider.has_method("make_green")):
#if yes then do it
collider.make_green()
if can_be_deleted:
spawn_particles()
queue_free()
func set_particle_direction(collider):
if (collider.has_method("set_particle_direction")):
collider.set_particle_direction(linear_velocity.normalized() * -1)
func set_can_be_deleted(value):
can_be_deleted = value
func get_can_be_deleted():
return can_be_deleted
func spawn_particles():
var NewParticles = preload("res://Pegs/Yellow/Powerups/Scattershot/ScattershotBallParticles.tscn")
var particles = NewParticles.instance()
var main = get_tree().current_scene
particles.global_position = global_position
main.add_child(particles)

View file

@ -0,0 +1,50 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Pegs/Yellow/Powerups/Scattershot/Scattershot-Sheet.png" type="Texture" id=1]
[ext_resource path="res://Pegs/Yellow/Powerups/Scattershot/ScattershotBall.gd" type="Script" id=2]
[sub_resource type="CircleShape2D" id=1]
radius = 3.17969
[sub_resource type="ParticlesMaterial" id=2]
emission_shape = 1
emission_sphere_radius = 4.0
flag_disable_z = true
direction = Vector3( 0, 0, 0 )
gravity = Vector3( 0, -50, 0 )
orbit_velocity = 0.0
orbit_velocity_random = 0.0
color = Color( 0.968627, 1, 0.682353, 1 )
[node name="ScattershotBall" type="RigidBody2D"]
collision_layer = 0
mass = 2.0
contacts_reported = 1
contact_monitor = true
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
hframes = 6
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Timer" type="Timer" parent="."]
wait_time = 1.5
one_shot = true
autostart = true
[node name="CanBeDeletedTimer" type="Timer" parent="."]
wait_time = 0.25
one_shot = true
autostart = true
[node name="Particles2D" type="Particles2D" parent="."]
lifetime = 2.0
local_coords = false
process_material = SubResource( 2 )
[connection signal="timeout" from="Timer" to="." method="queue_free"]
[connection signal="timeout" from="Timer" to="." method="spawn_particles"]
[connection signal="timeout" from="CanBeDeletedTimer" to="." method="set_can_be_deleted" binds= [ true ]]

View file

@ -0,0 +1,4 @@
extends Particles2D
func _ready() -> void:
$AnimatedSprite.play("default")

View file

@ -0,0 +1,59 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://Pegs/Yellow/Powerups/Scattershot/Scattershot-Sheet.png" type="Texture" id=1]
[ext_resource path="res://Pegs/Yellow/Powerups/Scattershot/ScattershotBallParticles.gd" type="Script" id=2]
[sub_resource type="ParticlesMaterial" id=1]
emission_shape = 1
emission_sphere_radius = 3.0
flag_disable_z = true
direction = Vector3( 0, -10, 0 )
spread = 70.08
gravity = Vector3( 0, 98, 0 )
initial_velocity = 49.18
orbit_velocity = 0.0
orbit_velocity_random = 0.0
color = Color( 0.968627, 1, 0.682353, 1 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 1 )
region = Rect2( 10, 0, 10, 10 )
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 1 )
region = Rect2( 20, 0, 10, 10 )
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 1 )
region = Rect2( 30, 0, 10, 10 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 1 )
region = Rect2( 40, 0, 10, 10 )
[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 1 )
region = Rect2( 50, 0, 10, 10 )
[sub_resource type="SpriteFrames" id=2]
animations = [ {
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ],
"loop": false,
"name": "default",
"speed": 15.0
} ]
[node name="ScattershotBallParticles" type="Particles2D"]
emitting = false
amount = 6
lifetime = 5.0
one_shot = true
explosiveness = 0.99
local_coords = false
process_material = SubResource( 1 )
script = ExtResource( 2 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 2 )
[connection signal="animation_finished" from="AnimatedSprite" to="." method="queue_free"]