This Script basically allows Peach to fly while she's in her racoon form like Mario and Co.
Before i remove this code from the hard drive,i aswell just release it here.
Code: Select all
-- SMBX - Peach flying Script by DarkShadeX
-- 0x1C = Princess hover timer
-- 0x16E = Is flying
-- 0xF0 = Player identity index (0 = nothing! don't use, 1 = demo, 2 = iris, 3 = princess, 5 = sheath)
local fly_lenght = 80 -- How long you can fly,adjust it so its perfect for you ;)
local remaining_fly = fly_lenght
function onLoop()
printText("RUNNING "..tostring(remaining_fly).." FRAMES", 30, 60)
-- If you Hover,prevent that you can fly:
if( player:mem(0x1C,FIELD_WORD) >= 1 )then
remaining_fly = 0
end
-- Check if Stuff ... :
if( player:mem(0x1C,FIELD_WORD) == 0 and player.speedY ~= 0 and remaining_fly >= 0 and player:mem(0xF0,FIELD_WORD) == 3 and player.speedX >= 5.55 and player.powerup == PLAYER_LEAF)then
player:mem(0x16E,FIELD_WORD,-1) -- LET THE FLY BEGIN :>
remaining_fly = remaining_fly - 0.25 -- Reduce our flying timer.
end
-- Check if Stuff ... LEFT :
if( player:mem(0x1C,FIELD_WORD) == 0 and player.speedY ~= 0 and remaining_fly >= 0 and player:mem(0xF0,FIELD_WORD) == 3 and player.speedX <= -5.55 and player.powerup == PLAYER_LEAF)then
player:mem(0x16E,FIELD_WORD,-1) -- LET THE FLY BEGIN :>
remaining_fly = remaining_fly - 0.25 -- Reduce our flying timer.
end
-- End the Flying:
if( remaining_fly <= 1 )then -- If you don't have any flying timer anymore...
player:mem(0x16E,FIELD_WORD,0) -- Stop the Flying.
end
-- Extra Fixes:
if( remaining_fly <= fly_lenght and player:mem(0x16E,FIELD_WORD) == -1 )then -- So the counter doesnt stop if you change the direction ;)
remaining_fly = remaining_fly - 0.25
end
end
function onJumpEnd()
remaining_fly = fly_lenght -- Reset the counter if you fall.
end