2022-04-13 08:38:32 +00:00
|
|
|
-- name: Mario RUN!
|
|
|
|
-- description: Mario is constantly running.
|
|
|
|
|
2024-07-13 18:46:41 +00:00
|
|
|
local speedThreshold = 50
|
2022-04-13 08:38:32 +00:00
|
|
|
|
2024-07-13 18:46:41 +00:00
|
|
|
local function mario_update(m)
|
|
|
|
--Prevent mario from crouching or idling
|
|
|
|
if m.action == ACT_IDLE or m.action == ACT_CROUCHING then
|
|
|
|
set_mario_action(m, ACT_WALKING, 0)
|
2022-04-13 08:38:32 +00:00
|
|
|
end
|
|
|
|
|
2024-07-13 18:46:41 +00:00
|
|
|
-- Ensures that Mario moves at a speed greater than or equal to speedThreshold
|
|
|
|
m.forwardVel = math.max(m.forwardVel,speedThreshold)
|
2022-04-13 08:38:32 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
-- hooks --
|
|
|
|
hook_event(HOOK_MARIO_UPDATE, mario_update)
|