Help collisions!

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

Styrofoam
Goomba
Goomba
Posts: 2
Joined: Wed Oct 28, 2020 7:56 pm

Help collisions!

Postby Styrofoam » Wed Oct 28, 2020 8:01 pm

Hi! I'm working on a project with a custom power up, by following this tutorial:
https://www.youtube.com/watch?v=T5p2GLC ... elRichards

The doublejump power up works with a jump counter, controlled by two conditions:
1) Mario must be in a specific power up state --> player:mem(0x112,FIELD_WORD) == x
2) Mario must stand on the ground to reset the jump counter ---> player:mem(0x146,FIELD_WORD) == 2

player:mem(0x146,FIELD_WORD) == 2 (Means that Mario is on the ground)
player:mem(0x146,FIELD_WORD) == 0 (Means that Mario is either in mid air or standing on top of npcs)
so when Mario is standing on certain npcs like moving platforms the jump counter won't reset and the doublejump ability goes off until Mario touches the ground again

How can i check if the player is standin on specific npcs? npc:mem(0x76,FIELD_BOOL) doesn't seem to work, or maybe i'm just stupid :roll:

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Help collisions!

Postby Emral » Fri Oct 30, 2020 4:22 am

For powerup state just use player.powerup, for grounded state just use player:isOnGround(). No need for memory offsets.
https://docs.codehaus.moe/#/reference/p ... ce-members


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari