Game data commit
This commit is contained in:
20
proto1/master.gd
Normal file
20
proto1/master.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
extends KinematicBody2D
|
||||
var motion : = Vector2()
|
||||
enum {STATE_NORMAL, STATE_DIALOGUE}
|
||||
var state = STATE_NORMAL
|
||||
func _ready():
|
||||
world.master_node = self
|
||||
func _physics_process(delta):
|
||||
match(state):
|
||||
STATE_NORMAL:
|
||||
var horizontal: float = Input.get_action_strength("move_east") - Input.get_action_strength("move_west")
|
||||
var vertical: float = Input.get_action_strength("move_south") - Input.get_action_strength("move_north")
|
||||
motion = Vector2(horizontal, vertical) * 140.5
|
||||
motion = move_and_slide(motion)
|
||||
|
||||
|
||||
func _process(delta):
|
||||
match(state):
|
||||
STATE_NORMAL:
|
||||
if Input.is_action_just_pressed("action1"):
|
||||
world.action1()
|
||||
Reference in New Issue
Block a user