Dancing With Monkeys & Forks

Dancing With Monkeys & Forks

しとしとぴっちゃん、しとぴっちゃん、しとぴっちゃん♪

Samurai Programmer Sawa (and cub) here!

Previously I talked about how “Over 70% of PixelJunk is done with scripts”. Today I want to speak a little bit more about “GameMonkey Script”. Why? Because I want more game developers throughout the world to use it!

To get the ball rolling, most of the basic things you’d need to know are available on the public page.

GameMonkey homepage

GameMonkey reference

Furthermore, we’ve gone and improved on this original flavour over time.

The convenience of threads should be felt in your belly every time you use them but, our GameMonkey is even simpler.. more convenient.. more wild!? You can make threads.


global WildThreadingFunction = function()
{
    local a = 10;

    fork
    {
        // This is a thread
        ...

        // the local variable gets copied so, "10" will be shown
        print( a );
    }

    local sound_pointer = Q.PlaySound( "WILD" );
    fork
    {
        // Here's another thread
        ...

        // Animation goes here
        ...
        sleep( 0.5f );
        ...
        sleep( 0.5f );

        sound_pointer.Stop();
    }
};

Do you feel it? Can you feel that convenience?

Making threads everywhere easily is all nice and good but, the real guts of the value is that local variables get copied into threads right? With this, you can get rid of a lot of useless variables and arguments, the data and processing can be squeezed into one place.

This is deeply concerned with the programs readability. It means you don’t need to jump around here there and everywhere in the editor looking for stuff!

Regarding this fork、it’s been implemented in the latest version of GameMonkey, so feel free to try using it!

ちゃぁん♪

That’s all for today!

monkeybot_folk

2 thoughts on “Dancing With Monkeys & Forks

  1. Hey, thanks for sharing the technical details.
    Have you encountered any problems with localization? AFAIK GameMonkey’s strings contain ansi characters only.

    • Fortunately no. We made a custom class called GM_Wstring that lets us use multibyte characters. :D

Comments are closed.