For some reason I feel like this code here - causes - SMBX to place a "checkpoint" at the start, which however kills you anyway.
This unplaced and still existing checkpoint ONLY appears, if I place a real checkpoint within the level (npc-430).
On the screenshots it is titled with "checkpoint 1". If NOT placed, then the faulty checkpoint does not appear as well.
However the placed checkpoint is not properly registered and can not be selected from the test menu and also gets ignored when "collected" ingame.
This "very tall" checkpoint, I want to note, does work with the first level where I have put 3 of them. They are supposed to mimic the oldskool-invisible-checkpoints of SMB1 or SML1 on gameboy. So it must have something to do with the luna lua code of this own level.
"--checkpoint 1 (real start)" is actually the deleted checkpoint.
In SMB1 - if you restart an underground or waterlevel after the "mario goes to the pipe really slow" you do not watch the sequence a second time but rather you start at the actual begin of the level.
Code as follows:
Code: Select all
--for Underground and Water Levels
local inputs2 = API.load("inputs2")
Timer.setSecondLength(40)
moveToPipe = 0
function onStart()
if moveToPipe == 0 and player.section == 0 then
Defines.player_walkspeed = 2.5
moveToPipe = 1
inputs2.locked[1].all = true
end
--checkpoint 1 (real start)
if player.x == -179852 and player.section == 1 then
Routine.run(delayPipeSFX)
end
end
function delayPipeSFX()
Misc.pause()
Timer.activate()
Timer.set(400)
Routine.waitSeconds(2.0, true)
Misc.unpause()
Audio.playSFX(17)
end
function onTick()
--Text.print(player.x, 100, 100)
if moveToPipe == 1 then
player.keys.right = true
end
if moveToPipe == 1 and player.section == 1 then
Timer.activate()
Timer.set(400)
inputs2.locked[1].all = false
Defines.player_walkspeed = 3
moveToPipe = 0
end
end
function onEvent(calledEvent)
if(calledEvent == "BigBlockScript") then
Defines.earthquake = 20
Audio.playSFX(37)
end
end
Screenshot as follows, hopefully showing the whole situation:
