1 parent
d1fb937a93
commit
f94d68efef
8 files changed
+78
-86
No files matched your search
@@ -0,0 +1,23 @@
|
||||
extends Node2D
|
||||
|
||||
@export var max_distance = 260.0
|
||||
@export var moving = true
|
||||
var alt_position = Vector2(position.x + max_distance,0)
|
||||
@export var move_speed = 0.4
|
||||
|
||||
func _ready() -> void:
|
||||
alt_position = Vector2(position.x + max_distance,0)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if position.x != alt_position.x:
|
||||
position.x = move_toward(position.x, alt_position.x, move_speed)
|
||||
else:
|
||||
moving = false
|
||||
%Player2D.is_on_moving_platform = false
|
||||
#%Player2D.platform_speed = 0.0
|
||||
|
||||
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