Stack Flash game prototype

During the last days I received a lot of prototypes from different readers.

One I want to mention is something called “a new idea in AS2” by Shival Gupta

That’s how he got in contact with me:

Hi Emanuele.

A few days before you published some info on Box2d library in AS3 and one of the examples that it produced was of stacking boxes.

Eventually I developed this weak prototype on stacking in AS2 but it was really messy as each box had its own onEnterFrame function.

But anyways I think that the stacking concept has really great potential in making a game. If you are interested, shall I email that “poor” proto to you?

If you like that concept will you please publish a tutorial on it.
Understand, its a really cool concept and has great potential. I even has some ideas on making a stacking box game.

Please reply to this mail with your reply and suggestions.

Best regards

Coding a stacking prototype in AS2 is not that easy, and as you will see later in this post, Shival asked me to publish his prototype because “it would be an honour to me to get my work published in” and because the code has some bugs Shival is not able to fix at the moment, so he is asking for help to everybody.

The game concept is simple: you have something like a fan and have to shoot air to some falling colored crates in order to make them stop each one in the colored spot that matches the color of the crate.

The code is split through 5 frames, but the main engine is:

And Shival is asking for help in this way

Mouse is the only control for this game.

I have the scheme and concept of “STACK!” but due to my rookieness in flash, I cannot code a function. The function is to produce multiple boxes having the same property. But I made it really “unproper”.
For instance, if I have 5 boxes, I need 5 movieclip attachments, and 5*5 = 25 collisions.

Yes, A game can be made with all this fuss. 10 boxes and managing 10 x 10 = 100 collisions :(
But I know that there is also an easier way of making this game.

Also, can you fix the terrain collision code?
I tried my best but nothing better happened.

So pls download the attachment “Stack!.fla” ,” Stack!.swf”
and pls help me out.

I hope you like my idea (a game in future).

Download the source code and give him feedback

  • Not bad! I rather like the concept. With some fixes (Notably it is rather annoying hitting the reset button when you’re firing at a block that happens to be in that direction, and a bug when a block is hit too fast it flys through the wall), I think it could be a rather enjoyable game. =)

  • Thanks Emanuele,
    I am really honoured.
    For everyone who reads this:
    Please help me reduce the code size.
    That collisions = (crates)*(crates) formula is really a mess.

  • hey anyone knows a site for cool background music of low size (not in rar or zip) in mp3 format?

  • RJ

    Well, I’ve been looking for that kind of music for a long time, and I think one of the best solutions is to look in Newgrounds Audio portal in the Jazz category, jazz is quite good as background music.Anyway, you can search for:

    – Twilight Techno
    – Surface
    – Chaoz fantasy
    – Mazidon’s fury
    – A simple jazz

    Those aren’t jazz (except of A simple jazz, of course) but are also good.

    I hope this helps

  • shiv1411

    I think something you could try would be pretending that the boxes cant get within a certain distance of each other. Then, if they are, move them apart.
    Check distance
    ydif = junk._y-lunk._y;
    xdif = junk._x-lunk._x;
    dis = Math.sqrt(ydif*ydif+xdif*xdif);

  • Thanx And Mar,
    I fixed that problem. I just subtracted a few pixels from the box to box collision and now it is working absolutely fine. I think I would be able to complete the game till the next sunday.

  • Thanx RJ

  • I understand Nothing ! .

  • good work shiv!

  • Thanx thomas.

    Expect the game at newgrounds on next sunday.