2022-03-19 04:30:53 +00:00
|
|
|
-- name: Mario RUN!
|
2022-03-23 02:51:25 +00:00
|
|
|
-- description: Mario is constantly running.
|
2022-03-19 04:30:53 +00:00
|
|
|
|
|
|
|
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)
|