This commit is contained in:
1 parent
3b0b981337
commit
43b38b2428
13 files changed
+500
-12
No files matched your search
@@ -0,0 +1,28 @@
|
||||
extends Node2D
|
||||
|
||||
@export var max_distance = 260.0
|
||||
@export var spawn_delay = 0.0
|
||||
var alt_position = Vector2(position.x + max_distance,0)
|
||||
@export var halfswing_cw = false
|
||||
@export var halfswing_ccw = false
|
||||
@export var halfswing_cw_2 = false
|
||||
@export var halfswing_ccw_2 = false
|
||||
|
||||
func _ready() -> void:
|
||||
alt_position = Vector2(position.x + max_distance,0)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
await get_tree().create_timer(spawn_delay).timeout
|
||||
if halfswing_cw: $AnimationPlayer.play("halfswing_cw")
|
||||
elif halfswing_ccw: $AnimationPlayer.play("halfswing_ccw")
|
||||
elif halfswing_cw_2: $AnimationPlayer.play("halfswing_cw_2")
|
||||
elif halfswing_ccw_2: $AnimationPlayer.play("halfswing_ccw_2")
|
||||
else:
|
||||
$AnimationPlayer.play("RESET")
|
||||
%Player2D.is_on_moving_platform = false
|
||||
|
||||
func on_contact(body: Node2D) -> void:
|
||||
if body==%Player2D and %Player2D.death_cooldown == 0:
|
||||
print("SLASH KILL")
|
||||
%Player2D/Jetpack/DeathSound.play()
|
||||
%Player2D.on_death(false,%Player2D.position)
|
||||
Reference in new issue
Block a user