Making Mario automatically walk right like in SM Run?

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
RhysOwens
Nipper
Nipper
Posts: 423
Joined: Fri Apr 22, 2016 2:53 am

Making Mario automatically walk right like in SM Run?

Postby RhysOwens » Fri Dec 16, 2016 12:24 pm

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.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

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

Postby PixelPest » Fri Dec 16, 2016 12:25 pm

Code: Select all

function onInputUpdate()
    player.rightKeyPressing = true; 
end

RhysOwens
Nipper
Nipper
Posts: 423
Joined: Fri Apr 22, 2016 2:53 am

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

Postby RhysOwens » Sat Dec 17, 2016 2:07 pm

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?

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Contact:

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

Postby MECHDRAGON777 » Tue Jan 03, 2017 7:00 am

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)

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

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

Postby PixelPest » Tue Jan 03, 2017 9:01 am

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


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 5 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari