-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimController.lua
More file actions
38 lines (30 loc) · 1 KB
/
AnimController.lua
File metadata and controls
38 lines (30 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- animation controller
require 'charactercontroller'
animationController = {}
local playerState
function animationController:load()
animationContoller = {attacking = false, moving = false, shooting = false, idle = true, state = nil}
playerState = player.bools
end
function animationController:update()
animationContoller = {attacking = false, moving = false, shooting = false, idle = true, state = nil}
playerState = player.bools
if playerState.shooting then
animationController.shooting = true
animationController.state = "Shooting2"
end
if playerState.attacking then
animationController.attacking = true
animationController.state = "SwordAttack1"
end
if playerState.moving then
animationController.moving = true
animationController.state = "Walk"
end
if not animationController.moving and not animationController.attacking and not animationController.shooting then
animationController.idle = true
animationController.state = "Idle"
end
end
function animationController:getState()
end