LunaDLL help
Posted: Tue Oct 14, 2014 10:39 pm
I can make Leaf/Tanooki Mario, Leaf/Tanooki Luigi and Leaf/Tanooki Peach double-jump?
I think this'll help:Kei wrote:I can make Leaf/Tanooki Mario, Leaf/Tanooki Luigi and Leaf/Tanooki Peach double-jump?
Code: Select all
canDoublejump = true
function onLoad()
canDoublejump = true
end
function onJumpEnd()
canDoublejump = true
end
function onLoop()
if(uservar["jump-counter"]~=0)then
printText("Jumps: "..tostring(uservar["jump-counter"]), 30, 160)
end
end
function onKeyDown(keycode)
if(canDoublejump and keycode == KEY_JUMP and player:mem(0x60,FIELD_WORD) == -1)then --0x60 is the memory offset if the player is in the air. -1 means the player is in air.
player.speedY = -1
canDoublejump = false;
if(uservar["jump-counter"]~=0)then
uservar["jump-counter"] = uservar["jump-counter"] + 1
else
uservar["jump-counter"] = 1
end
end
end
function onJump(plIndex)
if(uservar["jump-counter"]~=0)then
uservar["jump-counter"] = uservar["jump-counter"] + 1
else
uservar["jump-counter"] = 1
end
UserData.save()
end