Page 1 of 1

Making Mario automatically walk right like in SM Run?

Posted: Fri Dec 16, 2016 12:24 pm
by RhysOwens
I'm 100% sure that's possible but I don't know how to do it.
I want to know how to do this because I may make a level with this mechanic in the future.

Re: Making Mario automatically walk right like in SM Run?

Posted: Fri Dec 16, 2016 12:25 pm
by PixelPest

Code: Select all

function onInputUpdate()
    player.rightKeyPressing = true; 
end

Re: Making Mario automatically walk right like in SM Run?

Posted: Sat Dec 17, 2016 2:07 pm
by RhysOwens
But how do I make it so the mushrooms or whatever item you choose come straight out of the block and jump to the right?

Re: Making Mario automatically walk right like in SM Run?

Posted: Tue Jan 03, 2017 7:00 am
by MECHDRAGON777
RhysOwens wrote:But how do I make it so the mushrooms or whatever item you choose come straight out of the block and jump to the right?
The code PixelPest gave makes Mario always go to the right. It is the same as not being able to let off of the right arrow key. (Or what ever your controls may be)

Re: Making Mario automatically walk right like in SM Run?

Posted: Tue Jan 03, 2017 9:01 am
by PixelPest
RhysOwens wrote:But how do I make it so the mushrooms or whatever item you choose come straight out of the block and jump to the right?
You'll probably need an NPC.getIntersecting call to check if the mushroom has come out of the block and if so modify its speedX and speedY values to launch it for a certain period of time. To do this you'll need pnpc.lua for that counter such that you aren't launching it forever