Basic events system started.
This commit is contained in:
@@ -27,9 +27,16 @@ func updateOverworldLogic(delta) -> void:
|
||||
func updateMovement(delta) -> void:
|
||||
# User movement
|
||||
var dir:Vector2 = Input.get_vector("left", "right", "up", "down");
|
||||
|
||||
var moveSpeed:float;
|
||||
if Input.is_action_pressed("run"):
|
||||
moveSpeed = runSpeed;
|
||||
else:
|
||||
moveSpeed = speed;
|
||||
|
||||
if(dir.x != 0 or dir.y != 0):
|
||||
velocity.x = dir.x * speed * delta;
|
||||
velocity.z = dir.y * speed * delta;
|
||||
velocity.x = dir.x * moveSpeed * delta;
|
||||
velocity.z = dir.y * moveSpeed * delta;
|
||||
|
||||
# Update direction
|
||||
if(dir.x >= abs(dir.y) and(
|
||||
@@ -48,4 +55,3 @@ func updateMovement(delta) -> void:
|
||||
direction = Direction.SOUTH;
|
||||
elif (dir.y < 0):
|
||||
direction = Direction.NORTH;
|
||||
pass
|
||||
|
Reference in New Issue
Block a user