Files
JumpRopeOldTech/saw.gd
T
TheRailGoat 656026aa09
ci/woodpecker/push/woodpecker Pipeline was successful
Minor Level Tweaks +Hat
2026-10-29 23:07:44 -05:00

28 lines
903 B
GDScript

extends Node2D
@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_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_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
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)