Walljumps.lua (v1.2)

Share and discuss custom LunaLua code and content packs for SMBX2.
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Walljumps.lua (v1.2)

Postby PixelPest » Wed Jul 27, 2016 2:17 pm

I wrote an API yesterday that allows walljumping universally for all characters. Although it's a little tough to get it to work with Peach due to the hover, you can still get her to walljump if you get the timing right. v1.1 adds a new variable (see below). Thanks to Enjl for the suggestion. This version is still compatible with levels using the older version. Also as of v1.2 the player can no longer walljump when holding an item and also can't walljump while on a mount (boot, Yoshi, or clown car).



The following are variables that can be accessed via a lunadll.lua file, etc.:
  • walljumps.slideSpeed: Speed when sliding down walls. (Default: 3, Recommended Range: 2.5-3.5)
  • walljumps.jumpIntensityX: Absolute speed of how fast the player travels along the horizontal axis after walljumping. (Default: 3, Recommended Range: 3-5)
  • walljumps.jumpIntensityY: Speed of how fast the player travels along the vertical axis after walljumping. (Default: -9, Recommended Range: 8.5-10)
  • walljumps.delayTime: Time (in seconds) that the player has to wait to walljump after making contact with the wall. (Default: 0.25, Recommended Range: 0-0.4)
New v1.1:
  • walljumps.forceRelease: True or false (boolean) whether or not the player must release the jump key before performing a wall jump. (Default: false)
Example:

Code: Select all

local walljumps = API.load("walljumps");

walljumps.slideSpeed = 2.5;
walljumps.jumpIntensityX = 3.5
Download:

Hastebin (copy and save as a .lua file entitled "walljumps"): https://hastebin.com/ejakofuyed.lua
Dropbox (.zip file; includes test level--shown in video): https://www.dropbox.com/s/qcdcct0xzvyhu ... a.zip?dl=0
Last edited by PixelPest on Sun Dec 03, 2017 2:13 pm, edited 3 times in total.

loop13
Eerie
Eerie
Posts: 978
Joined: Sun Apr 17, 2016 5:56 pm
Flair: I mainly play Celeste nowadays
Current Project: failing English IV
Chat Username: loop13uh

Re: Walljumps.lua

Postby loop13 » Wed Jul 27, 2016 2:23 pm

This looks very useful. Could be useful for my project (or anybody else's project for that matter.).
Hello, I make a lot of typos
specific people know my whereabouts though

my wifi is as useful as a brick

im more active on discord

:idea: I'm not (completely) dead; I rarely talk because I usually have nothin to say; I'll talk when I actually have a comment I want to make, or if someone asks me somethin...

nostalgia is a beautiful thing, isn't it?

anything before 2020 is most likely me being a weirdo or an idiot.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7917
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Walljumps.lua

Postby Enjl » Wed Jul 27, 2016 2:23 pm

shoutout to the other dozen people who made walljump in the past
ImageImageImageImage
ImageImageImageImageImageImage

Enchlore
Mega Mole
Mega Mole
Posts: 273
Joined: Thu May 08, 2014 3:40 pm

Re: Walljumps.lua

Postby Enchlore » Wed Jul 27, 2016 2:24 pm

So it's more of a Mega Man X style wall jump... this is going to be, like, very useful for me. I was going to try to figure out how to code an MMX-style wall jump and this saves me a lot of work. Is it possible to assign a new sprite for sliding on the wall using empty spaces on the player GFX file?
Image

PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Walljumps.lua

Postby PixelPest » Wed Jul 27, 2016 2:40 pm

Enchlore wrote:So it's more of a Mega Man X style wall jump... this is going to be, like, very useful for me. I was going to try to figure out how to code an MMX-style wall jump and this saves me a lot of work. Is it possible to assign a new sprite for sliding on the wall using empty spaces on the player GFX file?
I was considering that. The issue revolves around all of the different characters with different empty spaces, especially with 2.0 coming out, which has character costumes that have different hitboxes, etc. The other issue with using those empty spaces is setting the hitboxes for them. I would suggest using an already existing sprite on the spritesheet, for example, when I had this idea earlier, I looked at using the jump animations of Mario and Luigi, since they have one hand in the air

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7917
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Walljumps.lua

Postby Enjl » Wed Aug 03, 2016 2:08 pm

After playing through a level with this I have noticed some issues.
1) You can just hold a button and jump your way into space, which feels awkward and is just wrong.
2) You don't "stick" to the wall, which makes jumping to walls on the opposite side very tricky and uncomfortable to control.
ImageImageImageImage
ImageImageImageImageImageImage

PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Walljumps.lua

Postby PixelPest » Wed Aug 03, 2016 2:17 pm

Enjl wrote:After playing through a level with this I have noticed some issues.
1) You can just hold a button and jump your way into space, which feels awkward and is just wrong.
2) You don't "stick" to the wall, which makes jumping to walls on the opposite side very tricky and uncomfortable to control.
If you can explain further, I'll see what I can do. What do you mean by "jump your way into space"? And I also don't understand what you're referring to by "stick"

User avatar
Anthony Valle
Spiny
Spiny
Posts: 50
Joined: Mon Dec 21, 2015 5:27 pm
Current Project: Legend of the Golden Shrooms

Re: Walljumps.lua

Postby Anthony Valle » Wed Aug 03, 2016 2:30 pm

Will this be included in SMBX 2.0? Just asking.
Also, this looks good so far, well done.
Read your bible everyday guys!
I support SMBX 1.3.0.1
I support Platformer Game Engine (PGE) by Wolhstand
I support Lunalua by Kevsoft
I support SMBX 2.0 by Horikawa Otane

Image Image Image Image Image Image Image

Projects In support:
Image

Geometry Dash profile:
Image

Clash of Clans profile:

Image

Image

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7917
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Walljumps.lua

Postby Enjl » Wed Aug 03, 2016 2:43 pm

PixelPest wrote:
Enjl wrote:After playing through a level with this I have noticed some issues.
1) You can just hold a button and jump your way into space, which feels awkward and is just wrong.
2) You don't "stick" to the wall, which makes jumping to walls on the opposite side very tricky and uncomfortable to control.
If you can explain further, I'll see what I can do. What do you mean by "jump your way into space"? And I also don't understand what you're referring to by "stick"
1) You'll jump off a wall as long as the jump button is pressed after the initial delay is over, which means that as long as you're enclosed between two walls, holding the jump button is enough to propel you all the way to the top:
ImageImage

2) Usually when you have walljump code, you give the player a certain amount of tolerance before detaching them from the wall, to let them switch over to moving into the opposite direction without losing the ability to jump off the wall. Just play New Super Mario Bros. for the DS.
Image
ImageImageImageImage
ImageImageImageImageImageImage

PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Walljumps.lua

Postby PixelPest » Wed Aug 03, 2016 2:57 pm

Enjl wrote:1) You'll jump off a wall as long as the jump button is pressed after the initial delay is over, which means that as long as you're enclosed between two walls, holding the jump button is enough to propel you all the way to the top:
ImageImage
So are you saying that the code should force the player to let go of the jump button?
Enjl wrote:2) Usually when you have walljump code, you give the player a certain amount of tolerance before detaching them from the wall, to let them switch over to moving into the opposite direction without losing the ability to jump off the wall. Just play New Super Mario Bros. for the DS.
Image
So you mean it should consider the player wallsliding if they're within a certain distance from the wall, not necessarily pushed directly up against it?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7917
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Walljumps.lua

Postby Enjl » Wed Aug 03, 2016 3:32 pm

No, no.
If you look at any other walljump in videogames you'll see that a PRESS of the button is required for the jump to take effect, not HOLDING it.

For the 2nd thing, play NSMBDS. The player does not even go away from the wall for a second or two. They stick to it.
ImageImageImageImage
ImageImageImageImageImageImage

User avatar
Turret 3471
Ripper II
Ripper II
Posts: 312
Joined: Sun Jul 31, 2016 12:43 pm
Contact:

Re: Walljumps.lua

Postby Turret 3471 » Wed Aug 03, 2016 7:53 pm

This is amazing!! Now I'm gonna need to think of how to use wall jumping in certain levels... Man, I guess you could say people are making SMBX great again! :lol:
I support:
Spoiler: show
Image
Image
Image Image
Image
Image
Image OHNO

Gud quotes
Spoiler: show
Witchking666 wrote:that looks aweozme alwo, sorrt im ik a big drunk. i may have drunk a lttle rtoo muxj beer with erik.

User avatar
timocomsmbx2345
Ninji
Ninji
Posts: 825
Joined: Sat Feb 06, 2016 1:44 pm
Current Project: i dont even know anymore. . . .
Chat Username: same as my username
Contact:

Re: Walljumps.lua

Postby timocomsmbx2345 » Thu Aug 11, 2016 1:15 pm

I would really love to see ground-pounding (if that's possible).
Also, THIS IS AWESOME!!
SMBX 2.0 β4 is here!!! How about 2.0 β5?
ImageImage
Image
Meepyglobix wrote:DON'T SAY "38A??". OR I'll SHOOT YOU.
Spoiler: show
Image Thanks Pixelpest!!!!
Image
Image

PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Walljumps.lua

Postby PixelPest » Thu Aug 11, 2016 1:26 pm

timocomsmbx2345 wrote:I would really love to see ground-pounding (if that's possible).
Also, THIS IS AWESOME!!
Thanks! By ground-pounding, do you want the maneuver from like Super Mario Galaxy and Super Mario 64? Like that ground pound?

User avatar
timocomsmbx2345
Ninji
Ninji
Posts: 825
Joined: Sat Feb 06, 2016 1:44 pm
Current Project: i dont even know anymore. . . .
Chat Username: same as my username
Contact:

Re: Walljumps.lua

Postby timocomsmbx2345 » Thu Aug 11, 2016 3:39 pm

PixelPest wrote:
timocomsmbx2345 wrote:I would really love to see ground-pounding (if that's possible).
Also, THIS IS AWESOME!!
Thanks! By ground-pounding, do you want the maneuver from like Super Mario Galaxy and Super Mario 64? Like that ground pound?
Super Mario 64 ground-pound.
SMBX 2.0 β4 is here!!! How about 2.0 β5?
ImageImage
Image
Meepyglobix wrote:DON'T SAY "38A??". OR I'll SHOOT YOU.
Spoiler: show
Image Thanks Pixelpest!!!!
Image
Image

User avatar
timocomsmbx2345
Ninji
Ninji
Posts: 825
Joined: Sat Feb 06, 2016 1:44 pm
Current Project: i dont even know anymore. . . .
Chat Username: same as my username
Contact:

Re: Walljumps.lua

Postby timocomsmbx2345 » Thu Aug 11, 2016 4:08 pm

THE WALL JUMPING DOESNT WORK!
SMBX 2.0 β4 is here!!! How about 2.0 β5?
ImageImage
Image
Meepyglobix wrote:DON'T SAY "38A??". OR I'll SHOOT YOU.
Spoiler: show
Image Thanks Pixelpest!!!!
Image
Image

PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Walljumps.lua

Postby PixelPest » Thu Aug 11, 2016 4:10 pm

timocomsmbx2345 wrote:THE WALL JUMPING DOESNT WORK!
Can you be a little more specific as to what isn't working?

User avatar
timocomsmbx2345
Ninji
Ninji
Posts: 825
Joined: Sat Feb 06, 2016 1:44 pm
Current Project: i dont even know anymore. . . .
Chat Username: same as my username
Contact:

Re: Walljumps.lua

Postby timocomsmbx2345 » Thu Aug 11, 2016 4:14 pm

PixelPest wrote:
timocomsmbx2345 wrote:THE WALL JUMPING DOESNT WORK!
Can you be a little more specific as to what isn't working?
i got an error abut an "API" when i test it.
SMBX 2.0 β4 is here!!! How about 2.0 β5?
ImageImage
Image
Meepyglobix wrote:DON'T SAY "38A??". OR I'll SHOOT YOU.
Spoiler: show
Image Thanks Pixelpest!!!!
Image
Image

PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Walljumps.lua

Postby PixelPest » Thu Aug 11, 2016 4:15 pm

timocomsmbx2345 wrote:
PixelPest wrote:
timocomsmbx2345 wrote:THE WALL JUMPING DOESNT WORK!
Can you be a little more specific as to what isn't working?
i got an error abut an "API" when i test it.
What exactly is the error and what code do you have in your lunadll.lua file?

User avatar
underFlo
Mario
Mario
Posts: 4481
Joined: Mon Jul 14, 2014 10:44 am
Flair: sup im lesbiab
Current Project: actually nothing i lied to you
Chat Username: underFlo
Contact:

Re: Walljumps.lua

Postby underFlo » Thu Aug 11, 2016 5:29 pm

Sounds like you're using outdated LunaLua and the API.load in the 1st line errors, but I can't tell for sure until I've seen the error.
im a girl yo


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest