Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2018-11-18 01:41:20

SGWaS
Member
Registered: 2017-08-29
Posts: 95

Update + Wall Running code

Hey all! It's been a long while since I've posted here.

Due to several reasons, I haven't been able to work on Sonic in the MSS a whole lot, mainly because of more focus on my YouTube channel, and the fact that I lost the USB I had the WIP version of the game on for the 2nd time... hmm

I just found it again today, and have been at work on the game since, with other MODs showing me tricks that I could implement into the game to make it even better. One of these tricks is one that I revealed a long time ago; the wall running gimmick. Here is the code for it, since some of you requested that I share it:

object "Sideways Run"
{
    requires 0.2.0
    always_active
    state "main"
    {
        hide
        on_player_collision "run"
    }
    
    state "run"
    {
        set_player_animation "SD_TUX" 18
        set_player_xspeed 500
        set_player_yspeed 0
        simulate_button_up "left"
        on_button_down "up" "runup"
        on_button_down "down" "rundown"
    }
    
    state "runup"
    {
        set_player_animation "SD_TUX" 18
        set_player_xspeed 500
        set_player_yspeed -250
        simulate_button_up "left"
        on_button_up "up" "run"
    }
    
    state "rundown"
    {
        set_player_animation "SD_TUX" 18
        set_player_xspeed 500
        set_player_yspeed 250
        simulate_button_up "left"
        on_button_up "down" "run"
    }
}

It's pretty simple code; what basically happens is that the state "run" is triggered by Sonic running into the invisible object that has this state; when the state is ran, Sonic's sprite changes to a set of overhead view sprites on the spritesheet, and Sonic's horizontal speed is fixed at 500. The state is changed again when the player presses up or down, setting the vertical speed to -250 and 250 respectively.

"simulate_button_up 'left'" makes it so the player can't press the left key while in the state, so Sonic's sprite isn't flipped, giving the impression that he's running backwards.

When combined with a passable set of bricks, this could pull off a cool wall running effect. It could also be enhanced by adding diagonal sprites when the character travels up and down.

So that's the code for the wall running effect I showed off a while ago. Speaking of a while ago, I see that I missed a lot, including the official introduction of SurgeScript. I'm probably going to finish Sonic in the MSS first before diving into SurgeScript, but it seems very exciting! smile

Also, if you've noticed videos of something called the "Spectrum" on my channel, it's because I've been participating in a fake console war roleplay in the logo community, the Spectrum being my system in the competition. I figured that the MODs I've made with Open Surge would be a great marketing ploy for the system that would give it a big edge over the rest, which would be having original "exclusive" games that were actually real! Pretty awesome idea, am I right? tongue

Here's an example of Sonic in the MSS being used to advertise the Spectrum in this commercial (that also pokes fun at the competition, naturally): https://www.youtube.com/watch?v=yn98yEg4vNc

So that's what I've been up to; I hope to work more on SitMSS, now that I have the opportunity to again. Thanks for your continued interest in my project, and congrats on the great amount of support and progress on SurgeScript! big_smile


-SGWaS

Offline

#2 2018-11-18 02:42:23

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Update + Wall Running code

Hey SGWaS, nice code smile

I use version control (git) when developing software. If you want something simpler, you can use Dropbox to keep your files safe.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org