Hi all,
I’m currently wondering how you use functions while using the storyboard.
I’m trying to use a function which incorporates the accelerometer, however it throughs error wherever I put it. My code is
local function moveKeeper:accelerometer(e) -- Accelerometer Movement keeper.x = display.contentCenterX + (display.contentCenterX \* (e.xGravity\*3)) if((keeper.x - keeper.width \* 0.5) \< 0) then keeper.x = keeper.width \* 0.5 elseif((keeper.x + keeper.width \* 0.5) \> display.contentWidth) then keeper.x = display.contentWidth - keeper.width \* 0.5 end end
I get the error
error loading module ‘fileName’ from file… ‘<’ expected.
I noticed that writing functions like:
local example = function()
works however how do I incorporate the
:accelerometer(e)
If you need more information please let me know!