Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends KinematicBody
- const MOVE_SPEED = 4
- const MOUSE_SENS = 0.5
- onready var anim_player = $AnimationPlayer
- onready var raycast = $RayCast
- func _ready():
- Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
- yield(get_tree(), "idle_frame")
- get_tree().call_group("zombies", "set player", self)
- func _input(event):
- if event is InputEventMouseMotion:
- rotation_degrees.y -= MOUSE_SENS * event.relative.x
- func _process(_d):
- if Input.is_action_pressed("exit"):
- get_tree().quit()
- if Input.is_action_pressed("restart"):
- kill()
- func _physics_process(_d):
- var move_vec = Vector3()
- if Input.is_action_pressed("move_forwards"):
- move_vec.z -= 1
- if Input.is_action_pressed("move_backwards"):
- move_vec.z += 1
- if Input.is_action_pressed("move_left"):
- move_vec.x -= 1
- if Input.is_action_pressed("move_right"):
- move_vec.x += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement