This commit is contained in:
1 parent
43b38b2428
commit
656026aa09
3 files changed
+204
-3
No files matched your search
@@ -1,17 +1,21 @@
|
||||
extends Node2D
|
||||
|
||||
@export var max_distance = 260.0
|
||||
@export var max_distance_x = 100.0
|
||||
@export var max_distance_y = 100.0
|
||||
@export var moving = true
|
||||
var alt_position = Vector2(position.x + max_distance,0)
|
||||
var alt_position = Vector2(position.x + max_distance_x,0)
|
||||
var alt_position2 = Vector2(position.x - max_distance_x,0)
|
||||
@export var move_speed = 0.0
|
||||
|
||||
func _ready() -> void:
|
||||
alt_position = Vector2(position.x + max_distance,0)
|
||||
alt_position = Vector2(position.x + max_distance_x,0)
|
||||
alt_position2 = Vector2(position.x - max_distance_x,0)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if position.x != alt_position.x:
|
||||
position.x = move_toward(position.x, alt_position.x, move_speed)
|
||||
else:
|
||||
position.x = move_toward(position.x, alt_position2.x, move_speed)
|
||||
moving = false
|
||||
%Player2D.is_on_moving_platform = false
|
||||
#%Player2D.platform_speed = 0.0
|
||||
|
||||
Reference in new issue
Block a user