Page 1 of 1

how do you make a custom character

Posted: Sun Sep 18, 2022 3:54 pm
by Knitted_Egg
hello I want to make a character that is similar to mario but is slower and can do a double jump but how do I make a custom character? I know there is custom character blocks but I just want to make a custom character.

Re: how do you make a custom character

Posted: Sun Sep 18, 2022 4:11 pm
by deice
if you just want mario but slower and with a double jump, you actually don't need a completely custom character.
the player's speed cap can be controlled by "Defines.player_runspeed" and "Defines.player_walkspeed" (though the latter cap won't apply to any manual speed boosts that the player receives)
as for double jump, i believe there's a library for it on the wohsoft forums but it might be outdated. in any case, it shouldn't be too hard to implement if you know how to use events and player memory offsets; also maybe taking a look at the source code would help with figuring the physics out. (at any rate it's much much easier to do than creating an entire new character)

Re: how do you make a custom character

Posted: Sun Sep 18, 2022 4:17 pm
by LooKiCH
for double jump create local variable and use "function onKeyDown(k)", "player.speedY", "SFX.play(1)" and "if k == KEY_JUMP or k == KEY_SPINJUMP then"

Re: how do you make a custom character

Posted: Sun Sep 18, 2022 9:29 pm
by Marioman2007
LooKiCH wrote:
Sun Sep 18, 2022 4:17 pm
for double jump create local variable and use "function onKeyDown(k)", "player.speedY", "SFX.play(1)" and "if k == KEY_JUMP or k == KEY_SPINJUMP then"

A better approach would be:

Code: Select all

function onInputUpdate()
    if player.keys.jump == KEYS_PRESSED or player.keys.altJump == KEYS_PRESSED then
        -- do stuff
    end
end