mirror of
https://git.kittycat.homes/zoe/pegchamp.git
synced 2024-08-15 03:15:39 +00:00
added cool animations
This commit is contained in:
parent
6cb03fda72
commit
62762082f7
8 changed files with 17 additions and 6 deletions
|
@ -26,6 +26,7 @@ func moveup():
|
||||||
|
|
||||||
func movedown():
|
func movedown():
|
||||||
var _collide = move_and_collide(Vector2(0, 5))
|
var _collide = move_and_collide(Vector2(0, 5))
|
||||||
|
GameStats.set_multiplier(1)
|
||||||
|
|
||||||
func _on_ZoneDetection_area_entered(_area):
|
func _on_ZoneDetection_area_entered(_area):
|
||||||
if (state == MOVEUP):
|
if (state == MOVEUP):
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
extends Button
|
extends Button
|
||||||
|
|
||||||
export var scene = "res://Menu/MainMenu.tscn"
|
export var scene = "res://Menu/MainMenu.tscn"
|
||||||
|
export var powerup_card = "res://Pegs/Yellow/PowerupCards/ExtraBall.tscn"
|
||||||
export var unlock_points_required = 0
|
export var unlock_points_required = 0
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
@ -10,3 +11,4 @@ func _ready():
|
||||||
|
|
||||||
func _on_SceneSelectButton_pressed():
|
func _on_SceneSelectButton_pressed():
|
||||||
GameStats.set_current_scene(scene)
|
GameStats.set_current_scene(scene)
|
||||||
|
GameStats.stage_powerup = powerup_card
|
||||||
|
|
|
@ -28,6 +28,7 @@ margin_right = 168.0
|
||||||
margin_bottom = 40.0
|
margin_bottom = 40.0
|
||||||
icon = ExtResource( 2 )
|
icon = ExtResource( 2 )
|
||||||
scene = "res://Stages/EmptyStage.tscn"
|
scene = "res://Stages/EmptyStage.tscn"
|
||||||
|
powerup_card = "res://Pegs/Yellow/PowerupCards/Scattershot.tscn"
|
||||||
|
|
||||||
[node name="SceneSelectButton2" parent="LevelListHBox" instance=ExtResource( 5 )]
|
[node name="SceneSelectButton2" parent="LevelListHBox" instance=ExtResource( 5 )]
|
||||||
anchor_right = 0.0
|
anchor_right = 0.0
|
||||||
|
|
|
@ -42,7 +42,7 @@ shape = SubResource( 1 )
|
||||||
shape = SubResource( 2 )
|
shape = SubResource( 2 )
|
||||||
|
|
||||||
[node name="GraceTimer" parent="." instance=ExtResource( 3 )]
|
[node name="GraceTimer" parent="." instance=ExtResource( 3 )]
|
||||||
wait_time = 0.24
|
wait_time = 1.0
|
||||||
|
|
||||||
[node name="HitSFX" parent="." instance=ExtResource( 4 )]
|
[node name="HitSFX" parent="." instance=ExtResource( 4 )]
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ script = ExtResource( 5 )
|
||||||
[node name="HitSFX" parent="." instance=ExtResource( 6 )]
|
[node name="HitSFX" parent="." instance=ExtResource( 6 )]
|
||||||
|
|
||||||
[node name="GraceTimer" parent="." instance=ExtResource( 3 )]
|
[node name="GraceTimer" parent="." instance=ExtResource( 3 )]
|
||||||
wait_time = 0.24
|
wait_time = 1.0
|
||||||
|
|
||||||
[node name="ScoreCounter" parent="." instance=ExtResource( 7 )]
|
[node name="ScoreCounter" parent="." instance=ExtResource( 7 )]
|
||||||
base_multiplier = 0
|
base_multiplier = 0
|
||||||
|
|
|
@ -11,7 +11,7 @@ func _ready() -> void:
|
||||||
func _physics_process(_delta):
|
func _physics_process(_delta):
|
||||||
var collider_array = get_colliding_bodies()
|
var collider_array = get_colliding_bodies()
|
||||||
for collider in collider_array:
|
for collider in collider_array:
|
||||||
set_particle_direction(collider)
|
set_particle_direction_for(collider)
|
||||||
turn_pegs_green(collider)
|
turn_pegs_green(collider)
|
||||||
|
|
||||||
func turn_pegs_green(collider):
|
func turn_pegs_green(collider):
|
||||||
|
@ -20,10 +20,9 @@ func turn_pegs_green(collider):
|
||||||
#if yes then do it
|
#if yes then do it
|
||||||
collider.make_green()
|
collider.make_green()
|
||||||
if can_be_deleted:
|
if can_be_deleted:
|
||||||
spawn_particles()
|
explode()
|
||||||
queue_free()
|
|
||||||
|
|
||||||
func set_particle_direction(collider):
|
func set_particle_direction_for(collider):
|
||||||
if (collider.has_method("set_particle_direction")):
|
if (collider.has_method("set_particle_direction")):
|
||||||
collider.set_particle_direction(linear_velocity.normalized() * -1)
|
collider.set_particle_direction(linear_velocity.normalized() * -1)
|
||||||
|
|
||||||
|
@ -39,3 +38,7 @@ func spawn_particles():
|
||||||
var main = get_tree().current_scene
|
var main = get_tree().current_scene
|
||||||
particles.global_position = global_position
|
particles.global_position = global_position
|
||||||
main.add_child(particles)
|
main.add_child(particles)
|
||||||
|
|
||||||
|
func explode():
|
||||||
|
spawn_particles()
|
||||||
|
queue_free()
|
||||||
|
|
|
@ -258,4 +258,7 @@ position = Vector2( 30, 124 )
|
||||||
|
|
||||||
[node name="PowerupCards" parent="." instance=ExtResource( 15 )]
|
[node name="PowerupCards" parent="." instance=ExtResource( 15 )]
|
||||||
|
|
||||||
|
[node name="YellowPeg2" parent="." instance=ExtResource( 4 )]
|
||||||
|
position = Vector2( 298, 53 )
|
||||||
|
|
||||||
[editable path="Ball"]
|
[editable path="Ball"]
|
||||||
|
|
|
@ -3,6 +3,7 @@ extends Node2D
|
||||||
export var stage_name = "test stage"
|
export var stage_name = "test stage"
|
||||||
export var high_score = 0
|
export var high_score = 0
|
||||||
export var already_beaten = false
|
export var already_beaten = false
|
||||||
|
export var powerup_card = "res://Pegs/Yellow/PowerupCards/ExtraBall.tscn"
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
load_level()
|
load_level()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue