Moved low gravity and mario run to examples
This commit is contained in:
parent
9793b56f84
commit
4008d99c75
|
@ -1,24 +1,24 @@
|
||||||
-- name: Mario RUN!
|
-- name: Mario RUN!
|
||||||
-- description: Mario is constantly running.
|
-- description: Mario is constantly running.
|
||||||
|
|
||||||
Threshold = 50 --set Threshold to 50
|
Threshold = 50 --set Threshold to 50
|
||||||
|
|
||||||
function mario_update(m)
|
function mario_update(m)
|
||||||
--Prevent mario from ideling
|
--Prevent mario from ideling
|
||||||
if m.action == ACT_IDLE then --If idle
|
if m.action == ACT_IDLE then --If idle
|
||||||
set_mario_action(m, ACT_WALKING, 0) --Make Mario walk
|
set_mario_action(m, ACT_WALKING, 0) --Make Mario walk
|
||||||
end
|
end
|
||||||
|
|
||||||
--Crouching doesnt apply vel so prevent that
|
--Crouching doesnt apply vel so prevent that
|
||||||
if m.action == ACT_CROUCHING then --If crouching
|
if m.action == ACT_CROUCHING then --If crouching
|
||||||
set_mario_action(m, ACT_WALKING, 0) --Make Mario walk
|
set_mario_action(m, ACT_WALKING, 0) --Make Mario walk
|
||||||
end
|
end
|
||||||
|
|
||||||
--Speed floor
|
--Speed floor
|
||||||
if (m.forwardVel > 0-Threshold) and (m.forwardVel < Threshold) then --If Mario isn't moveing fast enough
|
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
|
m.forwardVel = Threshold --set forwards velocity to whatevet the threashold is set to
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- hooks --
|
-- hooks --
|
||||||
hook_event(HOOK_MARIO_UPDATE, mario_update)
|
hook_event(HOOK_MARIO_UPDATE, mario_update)
|
|
@ -42,9 +42,9 @@ All of this is a holdover from when there were only two players. It was a reason
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
## Example Lua mods (small)
|
## Example Lua mods (small)
|
||||||
- [Low Gravity](../../mods/low-gravity.lua)
|
- [Low Gravity](examples/mods/low-gravity.lua)
|
||||||
- [Faster Swimming](../../mods/faster-swimming.lua)
|
- [Faster Swimming](../../mods/faster-swimming.lua)
|
||||||
- [Mario Run](../../mods/Mario-Run.lua)
|
- [Mario Run](examples/Mario-Run.lua)
|
||||||
- [HUD Rendering](examples/hud.lua)
|
- [HUD Rendering](examples/hud.lua)
|
||||||
- [Object Spawning](examples/spawn-stuff.lua)
|
- [Object Spawning](examples/spawn-stuff.lua)
|
||||||
- [Custom Ball Behavior](examples/behavior-ball.lua)
|
- [Custom Ball Behavior](examples/behavior-ball.lua)
|
||||||
|
|
Loading…
Reference in New Issue