From 4008d99c7515d6408b720ad10e13721236028887 Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 13 Apr 2022 01:38:32 -0700 Subject: [PATCH] Moved low gravity and mario run to examples --- {mods => docs/lua/examples}/Mario-Run.lua | 48 ++++++++++----------- {mods => docs/lua/examples}/low-gravity.lua | 0 docs/lua/lua.md | 4 +- 3 files changed, 26 insertions(+), 26 deletions(-) rename {mods => docs/lua/examples}/Mario-Run.lua (96%) rename {mods => docs/lua/examples}/low-gravity.lua (100%) diff --git a/mods/Mario-Run.lua b/docs/lua/examples/Mario-Run.lua similarity index 96% rename from mods/Mario-Run.lua rename to docs/lua/examples/Mario-Run.lua index 185412a3..790720ef 100644 --- a/mods/Mario-Run.lua +++ b/docs/lua/examples/Mario-Run.lua @@ -1,24 +1,24 @@ --- name: Mario RUN! --- description: Mario is constantly running. - -Threshold = 50 --set Threshold to 50 - -function mario_update(m) - --Prevent mario from ideling - if m.action == ACT_IDLE then --If idle - set_mario_action(m, ACT_WALKING, 0) --Make Mario walk - end - - --Crouching doesnt apply vel so prevent that - if m.action == ACT_CROUCHING then --If crouching - set_mario_action(m, ACT_WALKING, 0) --Make Mario walk - end - - --Speed floor - if (m.forwardVel > 0-Threshold) and (m.forwardVel < Threshold) then --If Mario isn't moveing fast enough - m.forwardVel = Threshold --set forwards velocity to whatevet the threashold is set to - end -end - --- hooks -- -hook_event(HOOK_MARIO_UPDATE, mario_update) +-- name: Mario RUN! +-- description: Mario is constantly running. + +Threshold = 50 --set Threshold to 50 + +function mario_update(m) + --Prevent mario from ideling + if m.action == ACT_IDLE then --If idle + set_mario_action(m, ACT_WALKING, 0) --Make Mario walk + end + + --Crouching doesnt apply vel so prevent that + if m.action == ACT_CROUCHING then --If crouching + set_mario_action(m, ACT_WALKING, 0) --Make Mario walk + end + + --Speed floor + if (m.forwardVel > 0-Threshold) and (m.forwardVel < Threshold) then --If Mario isn't moveing fast enough + m.forwardVel = Threshold --set forwards velocity to whatevet the threashold is set to + end +end + +-- hooks -- +hook_event(HOOK_MARIO_UPDATE, mario_update) diff --git a/mods/low-gravity.lua b/docs/lua/examples/low-gravity.lua similarity index 100% rename from mods/low-gravity.lua rename to docs/lua/examples/low-gravity.lua diff --git a/docs/lua/lua.md b/docs/lua/lua.md index aad3a0e3..5cf27f37 100644 --- a/docs/lua/lua.md +++ b/docs/lua/lua.md @@ -42,9 +42,9 @@ All of this is a holdover from when there were only two players. It was a reason
## Example Lua mods (small) -- [Low Gravity](../../mods/low-gravity.lua) +- [Low Gravity](examples/mods/low-gravity.lua) - [Faster Swimming](../../mods/faster-swimming.lua) -- [Mario Run](../../mods/Mario-Run.lua) +- [Mario Run](examples/Mario-Run.lua) - [HUD Rendering](examples/hud.lua) - [Object Spawning](examples/spawn-stuff.lua) - [Custom Ball Behavior](examples/behavior-ball.lua)