Page 1 of 1

SMB1 Physics

Posted: Fri Jul 03, 2020 2:57 pm
by thedarkcave215
Is there a way to recreate SMB1's running & jumping physics? In that game, Mario's jump height is short, but he stays in the air for longer, and he seems to stop a lot faster.

Re: SMB1 Physics

Posted: Fri Jul 03, 2020 3:00 pm
by Emral
A combination of playerphysicspatch and modification of Defines.player_runspeed and Defines.player_walkspeed and Defines.player_grav (acceleration) and Defines.gravity (terminal velocity) might get you there.

Re: SMB1 Physics

Posted: Fri Jul 03, 2020 10:17 pm
by thedarkcave215
Enjl wrote:
Fri Jul 03, 2020 3:00 pm
A combination of playerphysicspatch and modification of Defines.player_runspeed and Defines.player_walkspeed and Defines.player_grav (acceleration) and Defines.gravity (terminal velocity) might get you there.
Is there a way that I can do that episode-specific?

Re: SMB1 Physics

Posted: Fri Jul 03, 2020 10:30 pm
by Lusho
Uhh, what do you mean?, like that is something that happens episode specific, I don't see how some code would leak to other episodes (not counting having to modify the scripts folder which is a really bad idea)

Re: SMB1 Physics

Posted: Sat Jul 04, 2020 7:28 am
by Emral
As CJ said, all code you write is level or episode specific. Which one it is depends on where you put your luna.lua that runs the code (episode folder or level folder). The defines values for example are just global physics modifiers, which reset on reload and thus are best set in onStart:
https://wohlsoft.ru/pgewiki/SMBX_Fields
The playerphysicspatch library fills a similar niche.

Re: SMB1 Physics

Posted: Sat Jul 04, 2020 11:58 am
by thedarkcave215
Enjl wrote:
Sat Jul 04, 2020 7:28 am
As CJ said, all code you write is level or episode specific. Which one it is depends on where you put your luna.lua that runs the code (episode folder or level folder). The defines values for example are just global physics modifiers, which reset on reload and thus are best set in onStart:
https://wohlsoft.ru/pgewiki/SMBX_Fields
The playerphysicspatch library fills a similar niche.
My worry was that I tried to set Mario & Luigi's costumes to SMW-MARIO and SMW-LUIGI but that code carried over to every episode in my worlds folder, even though I had it placed in one particular episode folder.