(9 replies, posted in General)

Happy birthday.


(61 replies, posted in General)

aronthehedgehog wrote:

I'm sorry for butting in on the conversation (this should be in another section but...), Is it possible to set a custom fps for a Sprite via objects?

If it's not, that's ok, but I want to know if it's possible to do so. I want to play around with certain time variables and I want it to include sprite fps.

(I sped read the whole thing because I'm on time constraints right now, so if it's already an asked question I understand.)

Hi aronthehedgehog, welcome back. smile


In the API you're using, you can export data from objects using $_shared_variables (they start with a '_'). Eg: $_boss_x, $_boss_y.

See: http://opensnc.sourceforge.net/wiki/ind … ence#Scope

No problems, feel free to ask smile

Hi G.E.R.,

Please see the following commands: smile


(3 replies, posted in General)


Cool! smile

SGWaS wrote:

Is there a way that I could make the laser "invincible" where it would harm any object that collides with it?

You'll have to write a script, so your objects will be "harmable".

SGWaS wrote:

Can I also make the player vulnerable to any attack as well, even while jumping (I need this to make the dragon get hurt by enemies after flying off)?

I think KZR made something like that in Shinobi Densetsu; you might want to ask him.

Stop relying on the "enemy" decorator and write your own behaviors.
http://opensnc.sourceforge.net/wiki/ind … hit_player

G.E.R. wrote:

// ? ? ? on_wall_down "falling" ? ? ?  // Knuckles reached the bottob of the wall and falling

What if you implemented a collision detector instead of relying on on_right_wall_collision? smile You have more control over collisions that way. Then whenever Knuckles gets off the wall, you restore its regular movement.

Make sure you're also using disable_player_movement when wall climbing, otherwise Knuckles will be affected by gravity and regular user input, and it won't work this way.

G.E.R. wrote:

So, I need that Tails can flying and carried Sonic and I don't know how to do it. But this is not so important, if I can't made it, I can add moving platforms on my level.

Use set_player_position & set_absolute_position and it will work smile


(61 replies, posted in General)

Advanced features

A very nice feature of object-oriented programming languages is called a functor (or function object). It allows you to have objects that behave like functions.

In SurgeScript, you can do really powerful programming using functors. In the example below, we have an object called Benchmark that can measure the performance of any code/object that you provide:

// We'll measure the performance of the computation of the Fibonacci sequence using an exponential method
object "Application"
    benchmark = spawn("Benchmark");
    fib = spawn("Fibonacci");

    state "main"
        t  = benchmark(fib(1));
        t += benchmark(fib(5));
        t += benchmark(fib(10));
        t += benchmark(fib(25));
        t += benchmark(fib(32));
        Console.print("Total time: " + t + " seconds.");

In my computer, the output of this program is as follows:

Computing ExpFib(1) = 1          done in 0.000018 seconds.
Computing ExpFib(5) = 5          done in 0.000052 seconds.
Computing ExpFib(10) = 55          done in 0.000478 seconds.
Computing ExpFib(25) = 75025          done in 0.203170 seconds.
Computing ExpFib(32) = 2178309          done in 5.642050 seconds.
Total time: 5.845768 seconds.

Check out the full example!

Granted, it's an advanced feature. smile

Hey G.E.R., welcome to the forums. smile

Is this your first attempt at making levels? It's pretty good cool I particularly like the theme, and I see that you payed attention to detail.

Have you considered porting your work to Open Surge? You'll get more possibilities and an improved engine.


(3 replies, posted in MODs)

Hey SGWaS,

I already see a big improvement over your last project. Keep up the good work! wink

Suggestion: I think the brickset of the first level could get some more work (so you get smooth blocks, without holes in-between)

SGWaS wrote:

there will be a massive improvement from a design standpoint, at least in my opinion.

yes, give special attention to design. Your game will be great this way! cool


(3 replies, posted in General)

There is a way, sure. You already told us what the logic is: if there is not enough rings, get out of the stage (load some level). In other words, if not enough collectibles(), then load_level wink


(3 replies, posted in General)

Play it as a sample, rather than as a music.

It's simpler if you make your own object.


(1 replies, posted in Off-topic)

I read the goodbye letter from the guys at Vidme and they shared some insights about their market and their startup. They wanted a creator-friendly platform. One of their goals was to help video creators make money, so that they would be focused on making videos. Cool, but Google and Facebook pretty much control the online advertising market nowadays.


(23 replies, posted in MODs)

Hey SGWaS, I played the Halloween build. Some thoughts:

  • If I may, I'd suggest you use groups of bricks to ease level design.

  • That underground scene animation is crazy scary, dude.

  • That flying piranha eats all my charater's Memory. That is dangerous, because Vista may end up with Alzheimer's.

  • Lush shores is pretty cool cool I have already told that, haven't I?

  • Some levels are really difficult, like ME's Warehouse.

  • I can see you put more effort in some levels than in others. Midnight City and Lush Shores, for example, are both well designed and more polished compared to others with bricks floating around. Try improving all. You can totally do it smile

  • There is a part in Magma Mines that the lava started to go up. I couldn't climb the platforms, wouldn't jump high enough (and found no spring lol). I could get through that part later through pure luck roll

  • I totally love that Sonic Xtreme sound you used in Techno Traverse. Act 1 needs better level design. Act 2 is just crazy hard roll

  • I played a level called Fresh Firth Act 2 and liked it very much. The brickset is decent and it plays well. Nice gameplay. This is your best level so far, in my opinion. smile

    Compared to other levels, how was your experience building Fresh Firth?

Keep up the good work! cool


(23 replies, posted in MODs)

Hey SGWaS, nice work! I see that you changed the colors of the bricks. Even though the bricks still look a bit simple, the screens have improved a thousandfold! smile Now the levels have a totally different look, and they look like a bit cyberpunk. In terms of aesthetics, I feel that it is much more acceptable now.

If you would take the aethetic part a bit further, try eliminating the repetition of the bricks. Include new textures. This shouldn't be too hard, since you now have different bricksets for different levels.

Anyway, I'll play the demo as soon as I can! cool


(61 replies, posted in General)

TheSeventhEmerald wrote:

When will be integrated?

It's about to be integrated. One or two details to do, and the first build of SurgeScript will be done. Then comes the integration.


(23 replies, posted in MODs)

Hey SGWaS, good work. cool

This game can get fun, but it has to improve in terms of level design.

The opening scene repeated (character hits the spikes and dies). Next time it played, it finished properly. Remember that the framerate may vary a bit, so keep in mind that those spikes may harm the scene.


I'm still playing, and I explored a few different levels. Here are my suggestions:

1) Please consider using different bricksets throughout the game. Really. It's super important and gives a whole different look & feel to the game. The current Sunshine brickset is repeated everywhere. For example, in Magma Mines, it doesn't make much sense to have grass - in my opinion. Consider creating a different brickset, or at the very least, change the colors and the texture of the current brickset according to the context of the level.

2) Consider improving the level design. For example, I can see you put more effort in Lush Shores 1 than in some other levels (in terms of design).

3) There's a part in Flooded Mines that spikes appear out of nowhere. Consider giving the player a hint of where they are going to appear. In Techno Traverse, consider giving the player hints of where the platforms are. It gets too hard when there is an abyss in front of you (sometimes there is a moving platform, sometimes there is not).

4) I prefer having the user manual as pdf rather than rtf, but that's up to you (I use linux smile)

5) I see that you're experimenting with bosses and other very interesting things with scripting. Congratulations! wink


(4 replies, posted in Off-topic)

Welcome wink


(6 replies, posted in General)

It's easier if you make the whole thing via scripting.

See this: http://opensnc.sourceforge.net/wiki/ind … ayer_death


(6 replies, posted in General)

Hey SGWaS,

Yes, you'd have to write your own Game Over scene. It would be a level, like any other, except that it wouldn't be playable. So, when creating such a .lev, set players to "None". See below:

http://opensnc.sourceforge.net/wiki/ind … on#players

Also, set your startup object (in the .lev) to an object holding your custom logic.


(61 replies, posted in General)

Sorting in SurgeScript

One of the most important themes in computer science is sorting. In games, you may use sorting, for example, to create a high scores table and display the highest scores first. SurgeScript allows you to sort arrays using the sort() method: smile

Original array:
3 7 1 5 9 2 4 6 8 0
Sorting in ascending order...
0 1 2 3 4 5 6 7 8 9
Sorting in descending order...
9 8 7 6 5 4 3 2 1 0
Sorting in custom order (odds first)...
1 3 5 7 9 0 2 4 6 8

You can sort anything: numbers, strings and even more complex data.

Code link: sort_array.ss


(23 replies, posted in MODs)

No problem. Keep it up!


(61 replies, posted in General)


One of the most useful commands of the old API was on_timeout. Basically, it allowed to change the state of an object after a number of seconds passed. The same functionality can be achieved today in SurgeScript using timeout(): smile

object "Application"
    state "main"
        Console.print("Now on the main state. Please wait 4 seconds...");
        state = "wait1";

    state "wait1"
        if(timeout(4.0)) // will wait 4 seconds to change the state
            state = "cool";

    state "cool"
        Console.print("Cool! Now wait for more 8 seconds...");
        state = "wait2";

    state "wait2"
            state = "done";

    state "done"
        Console.print("You're done!");

Link: https://github.com/alemart/surgescript/ … timeout.ss


Create your state machine and then use set_obstacle as needed.

Additionally, see change_closest_object_state wink


(61 replies, posted in General)


SurgeScript is truly awesome. cool It can now handle more complex data structures such as Dictionaries. You can store arbitrary data in a Dictionary. As usual, you'll find fresh code on GitHub.

object "Application"
    // a Dictionary is a set of (key, value) elements
    weight = spawn("Dictionary");
    // main state
    state "main"
        // set up some weights ("weight" as in everyday use, that is)
        weight["Surge"] = 35.0;
        weight["Neon"] = 25.0;
        weight["Charge"] = 37.5;

        // print the weights
        Console.print("Surge weighs " + weight["Surge"] + " kg.");
        Console.print("Neon weighs " + weight["Neon"] + " kg.");
        Console.print("Charge weighs " + weight["Charge"] + " kg.");

        // sum up
        totalWeight = computeTotalWeight();
        Console.print("Together, they set up a total of " + totalWeight + " kg.");

        // done!

    // this function will add all weights stored in the Dictionary.
    fun computeTotalWeight()
        sum = 0.0;

        it = weight.iterator();
        while(it.hasNext()) {
            sum += weight[it.item];

        return sum;

The result is:

Surge weighs 35 kg.
Neon weighs 25 kg.
Charge weighs 37.500000 kg.
Together, they set up a total of 97.500000 kg.

ps: for those who had never heard the term "iterator", check out https://en.wikipedia.org/wiki/Iterator