]> Untitled Git - frog-ninja.git/blob - player/moves/Move.gd
Fixed falling
[frog-ninja.git] / player / moves / Move.gd
1 extends Node
2 class_name Move
3
4 ###
5 # flags and variables here
6 var player: Player
7 var camera: Camera3D
8
9 # enums are prioritized by order of list
10 static var moves_priority: Dictionary = {
11         "idle": 0,
12         "walk": 1,
13         "dash": 2,
14         "fall": 100
15 }
16
17 static func moves_priority_sort(a: String, b: String):
18         return moves_priority[a] > moves_priority[b]
19
20 ###
21
22 func should_enter(input: InputPacket) -> String:
23         if not player.is_on_floor():
24                 input.actions.append("fall")
25         input.actions.sort_custom(moves_priority_sort)
26         return input.actions[0]
27
28
29 func update(_input: InputPacket, _delta: float):
30         pass
31
32
33 func on_enter_state():
34         pass
35
36
37 func on_exit_state():
38         pass