|
@@ -15,10 +15,10 @@ var alive = true
|
|
|
|
|
|
# Enum
|
|
|
enum Direction {
|
|
|
- DIR_UP = 0
|
|
|
- DIR_RIGHT = 1
|
|
|
- DIR_DOWN = 2
|
|
|
- DIR_LEFT = 3
|
|
|
+ UP = 0
|
|
|
+ RIGHT = 1
|
|
|
+ DOWN = 2
|
|
|
+ LEFT = 3
|
|
|
}
|
|
|
|
|
|
# Movement
|
|
@@ -27,7 +27,7 @@ var posiy
|
|
|
var dirx = 0
|
|
|
var diry = 0
|
|
|
|
|
|
-export var dire = Direction.DIR_UP
|
|
|
+export var dire = Direction.UP
|
|
|
var dire_delta = 0
|
|
|
|
|
|
var is_moving = false
|
|
@@ -106,11 +106,11 @@ func _on_crash(b):
|
|
|
func turn(dir:int):
|
|
|
dirx = 0
|
|
|
diry = 0
|
|
|
- if dir == Direction.DIR_UP:
|
|
|
+ if dir == Direction.UP:
|
|
|
diry -= 1
|
|
|
- elif dir == Direction.DIR_RIGHT:
|
|
|
+ elif dir == Direction.RIGHT:
|
|
|
dirx += 1
|
|
|
- elif dir == Direction.DIR_DOWN:
|
|
|
+ elif dir == Direction.DOWN:
|
|
|
diry += 1
|
|
|
else:
|
|
|
dirx -= 1
|