diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2019-05-18 15:12:56 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2019-05-18 15:16:09 +0200 |
commit | 8c5320a94b4c91f2801c05766f6a1747de42a2e5 (patch) | |
tree | 549f3f5978ab9edd160325df52725cefe6366268 /cwd/assets/altcraft | |
parent | Integrated Optick profiler (diff) | |
download | AltCraft-8c5320a94b4c91f2801c05766f6a1747de42a2e5.tar AltCraft-8c5320a94b4c91f2801c05766f6a1747de42a2e5.tar.gz AltCraft-8c5320a94b4c91f2801c05766f6a1747de42a2e5.tar.bz2 AltCraft-8c5320a94b4c91f2801c05766f6a1747de42a2e5.tar.lz AltCraft-8c5320a94b4c91f2801c05766f6a1747de42a2e5.tar.xz AltCraft-8c5320a94b4c91f2801c05766f6a1747de42a2e5.tar.zst AltCraft-8c5320a94b4c91f2801c05766f6a1747de42a2e5.zip |
Diffstat (limited to 'cwd/assets/altcraft')
-rw-r--r-- | cwd/assets/altcraft/scripts/init.lua | 17 |
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 |