Moved low gravity and mario run to examples

This commit is contained in:
MysterD 2022-04-13 01:38:32 -07:00
parent 9793b56f84
commit 4008d99c75
3 changed files with 26 additions and 26 deletions

View file

@ -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)

View file

@ -42,9 +42,9 @@ All of this is a holdover from when there were only two players. It was a reason
<br />
## 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)