Big ol refactor of scripts
This commit is contained in:
@@ -9,6 +9,7 @@ module('entitycamera')
|
||||
local phys
|
||||
local updateSub
|
||||
local SPEED = 4.0
|
||||
local mat
|
||||
|
||||
function entityInit()
|
||||
local pos = entityPositionAdd(ENTITY_ID)
|
||||
@@ -22,8 +23,7 @@ function entityInit()
|
||||
local mesh = entityMeshAdd(ENTITY_ID)
|
||||
mesh:generateCapsule(0.3, 0.9)
|
||||
|
||||
local mat = entityMaterialAdd(ENTITY_ID)
|
||||
mat.color = colorBlue()
|
||||
mat = entityMaterialAdd(ENTITY_ID)
|
||||
|
||||
updateSub = eventSubscribe(SCENE_EVENT_UPDATE, onUpdate)
|
||||
end
|
||||
@@ -32,6 +32,8 @@ function onUpdate()
|
||||
local moveX = inputAxis(INPUT_ACTION_LEFT, INPUT_ACTION_RIGHT)
|
||||
local moveZ = inputAxis(INPUT_ACTION_DOWN, INPUT_ACTION_UP)
|
||||
|
||||
mat.color = colorRainbow()
|
||||
|
||||
local cam = entityCameraGetCurrent()
|
||||
local fwd = cam:getForward()
|
||||
local right = cam:getRight()
|
||||
|
||||
Reference in New Issue
Block a user