Initial commit
This commit is contained in:
commit
1514fe991b
675 changed files with 6030 additions and 0 deletions
44
scripts/player.gd
Normal file
44
scripts/player.gd
Normal file
|
@ -0,0 +1,44 @@
|
|||
extends Character
|
||||
|
||||
class_name PlayerHEHEHE;
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
print(get_tree().root);
|
||||
pass
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
other_input();
|
||||
move(get_direction_input())
|
||||
|
||||
|
||||
func get_direction_input() -> Globals.Direction:
|
||||
var direction : Globals.Direction;
|
||||
if Input.is_action_just_pressed("GoRight"):
|
||||
direction = Globals.Direction.RIGHT;
|
||||
elif Input.is_action_just_pressed("GoDown"):
|
||||
direction = Globals.Direction.DOWN;
|
||||
elif Input.is_action_just_pressed("GoLeft"):
|
||||
direction = Globals.Direction.LEFT;
|
||||
elif Input.is_action_just_pressed("GoUp"):
|
||||
direction = Globals.Direction.UP;
|
||||
else:
|
||||
direction = Globals.Direction.NONE;
|
||||
|
||||
|
||||
return direction;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func other_input() -> void:
|
||||
if Input.is_action_just_pressed("Replay"):
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
|
||||
|
||||
func _on_end_area_entered(area: Area2D) -> void:
|
||||
GameManager.next_level();
|
Loading…
Add table
Add a link
Reference in a new issue