Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Sprite
- var player = {grid_x = 256, grid_y = 256, act_x = 250, act_y = 250, speed = .5}
- var playerstart = Vector2(256,0)
- func _ready():
- set_process_input(true)
- set_process(true)
- set_pos(playerstart)
- func _process(delta):
- pass
- player.act_x = player.act_x - (player.act_x - player.grid_x) * player.speed * delta
- set_pos(Vector2(player.act_x,0))
- print(player.act_x)
- func _input(event):
- if Input.is_action_pressed("ui_left"):
- player.grid_x = player.grid_x - 64
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement