src / stages / gimmicks / springboard / springboard.tscn

Diagram

Diagram

Assets

200

Scene Tree

  • Springboard Sprite2D

    • Area2D Area2D

      • CollisionShape2D CollisionShape2D

    • AnimationPlayer AnimationPlayer

Signal Connections

$Area2D:[area_entered]⇒$.
func _on_area_2d_area_entered(area: Area2D) -> void:
	if standby: hit.call_deferred(area.owner as Player)
$AnimationPlayer:[animation_finished]⇒$.
func _on_animation_player_animation_finished(_anim_name: StringName) -> void:
	standby = true

Animations

Animation_veh16

Diagram

hit

Diagram

Properties

Table 1. Root properties
Name Value

scale

Vector2(8, 8)

texture

Springboard
Figure 1. res://assets/images/stages/gimmicks/Springboard.png

hframes

19

script

Table 2. $Area2D properties
Name Value

collision_mask

2

Table 3. $Area2D/CollisionShape2D properties
Name Value

position

Vector2(0.125, 6.125)

shape

SubResource("RectangleShape2D_veh16")

Table 4. $AnimationPlayer properties
Name Value

unique_name_in_owner

true

libraries/

SubResource("AnimationLibrary_vsbdv")

springboard.gd

extends Sprite2D

@onready var standby : bool = true
const FORCE := -1800


func hit(player: Player) -> void:
	standby = false
	player.velocity.y = FORCE
	player.regain_dash_charge()
	%AnimationPlayer.play(&'hit')


func _on_area_2d_area_entered(area: Area2D) -> void:
	if standby: hit.call_deferred(area.owner as Player)


func _on_animation_player_animation_finished(_anim_name: StringName) -> void:
	standby = true