summaryrefslogtreecommitdiffstats
path: root/cwd
diff options
context:
space:
mode:
Diffstat (limited to 'cwd')
-rw-r--r--cwd/assets/altcraft/scripts/init.lua17
1 files changed, 15 insertions, 2 deletions
diff --git a/cwd/assets/altcraft/scripts/init.lua b/cwd/assets/altcraft/scripts/init.lua
index 5fd9e11..2137464 100644
--- a/cwd/assets/altcraft/scripts/init.lua
+++ b/cwd/assets/altcraft/scripts/init.lua
@@ -4,6 +4,7 @@ local plugin = {
onLoad = nil,
onUnload = nil,
onChangeState = nil,
+ onTick = nil,
}
function plugin.onLoad ()
@@ -11,7 +12,19 @@ function plugin.onLoad ()
end
function plugin.onChangeState (newState)
- AC:LogWarning("New state: "..newState)
+ AC.LogWarning("New state: "..newState)
end
-AC:RegisterPlugin(plugin) \ No newline at end of file
+function plugin.onUnload ()
+ AC.LogInfo("AC Core unloaded")
+end
+
+function plugin.onTick (deltaTime)
+ if AC.GetGameState() and AC.GetGameState():GetPlayer() then
+ local player = AC.GetGameState():GetPlayer()
+ player.pos.x = player.pos.x + deltaTime * 0.5
+ end
+end
+
+AC.RegisterPlugin(plugin)
+plugin = nil \ No newline at end of file