idk
This commit is contained in:
parent
f4dc1a79fd
commit
f92b3a6f75
16 changed files with 217 additions and 39 deletions
|
@ -1,18 +1,25 @@
|
|||
extends "res://player.gd"
|
||||
|
||||
var can_jump = true
|
||||
|
||||
func _ready():
|
||||
speed = 1200
|
||||
$"../".get_node("%Ability").add_child(preload("res://portal-ability.tscn").instantiate())
|
||||
update_animation()
|
||||
if config.load("user://settings.cfg") == OK:
|
||||
absolute_movement = not config.get_value("config", "relative_controls")
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("jump"):
|
||||
if event.is_action_pressed("jump") and can_jump:
|
||||
can_jump = false
|
||||
$"../".get_node("%Ability/Portal").start_countup(0.5)
|
||||
$Sprite.speed_scale = 1
|
||||
$Sprite.play("jump")
|
||||
await $Sprite.animation_finished
|
||||
$"../".get_node("%Ability/Portal").start_countdown(0.5)
|
||||
global_position = get_global_mouse_position()
|
||||
$Sprite.speed_scale = -1
|
||||
$Sprite.play("jump")
|
||||
await $Sprite.animation_finished
|
||||
$Sprite.play("idle")
|
||||
can_jump = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue