alemart / opensurge

A retro game engine with a fun platformer for making your dreams come true!
http://opensurge2d.org
GNU General Public License v3.0
386 stars 33 forks source link

[feature] Stair bricktype #89

Closed Soufon7 closed 8 months ago

Soufon7 commented 8 months ago

example

Would be useful in making non-Sonic like games or just for, well, stairs. Setting a player's slope factor to 0 comes close to this, but slopes still affect jumping in that case.

alemart commented 8 months ago

You can use the engine to make various kinds of platformers, as well as non-platformers.

Your request can be fulfilled with a companion script. It can go along these lines:

// object-level variables
player = parent;
previouslyJumping = false;

...

fun lateUpdate()
{
    player.angle = 0;

    if(player.jumping && !previouslyJumping) {
        player.xsp = 0;
        player.ysp = -390;
    }

    previouslyJumping = player.jumping;
}