Full Totem Destroyer prototype

Some time ago I posted Create a Flash game like Totem Destroyer, and now I am showing you a complete prototype made by Collin Douch.

The prototype features slimy and non-removable blocks and collision detection between the totem and the ground.

Such detection was made customizing Box2D’s b2ContactListener class. For more information about this class refer to Understanding how Box2D manages collisions.

This is the main file:

and this is the custom b2ContactListener class

Download the full source code (Box2D excluded)

  • ElOIl

    hi, unfortunatelly I can´t open the totem.fla file. Seems to be damaged. Can you please check it!? :o)

  • Nice prototype, but I got an error while using the example… Something with destroyBody function…

  • ThomasTan

    LOL! THE SLIMY BLOCK IS DANCING!
    Cool!

  • Patrick Pietens

    Great tutorial!

    You’re implementing the custom b2ContactListener the wrong way though. It’s better practice to cache all collisions and wait till Box2D finished its timestep. Otherwise you may break your world.

    In this case it doesn’t really matter because the b2ContactListener only influences the graphics of the game. Not the bodies. But still, it’s better to do so :)

  • This does not seem to open up in Flash 8, would really love to be able to work with the source code, and was wondering if you would re-upload! Thanks!

  • zkkpos

    It is flash 9+ only, right?

  • isasu

    it says unexpected file format when i try to open it. Why?

  • isasu -> this is a flash cs4 file. If you have older version you will open as files only.

  • Kaaba

    How can I go to next level when, for example, totem hits the slimy block?

  • krisma

    can anyone help me, I get error on the prototype : undifined method Block, Floor, Totem, unBreakable, and Slimy.