Hello !
I'm having trouble making my player slide at different position, I tried to use move_toward(), manualy add 1 to my player x postion but it's not working.
Here is my code :
extends CharacterBody2D
@onready var collision_shape_2d = $CollisionShape2D
signal player_moved()
func _process(delta):
if Input.is_action_just_pressed("key_line_1"):
position.x = 235
position.y = 575
player_moved.emit()
if Input.is_action_just_pressed("key_line_2"):
position.x = 405
position.y = 575
player_moved.emit()
if Input.is_action_just_pressed("key_line_3"):
position.x = 575
position.y = 575
player_moved.emit()
if Input.is_action_just_pressed("key_line_4"):
position.x = 745
position.y = 575
player_moved.emit()
if Input.is_action_just_pressed("key_line_5"):
position.x = 915
position.y = 575
player_moved.emit()
My game look like a rythm game where you just have to move at 5 places
Please help me ;-;