Playing with APEs

Look at them go! Stupid primates.
Click ‘Spawn Platforms’ for a new layout, or play with the Platform and APE count steppers!

I finally found some time to play around with the AS3 physics engine, APE; something I have been meaning to do for a while now.

This is a pretty simple demo, and by no means pushes APE’s capabilities; however it should help introduce you to the API, as well as explaining how to create custom Classes which subclass the Group class in APE. This is a very useful method, as it means that you can build, for example, Classes for bridges, bone structures, Pinball style paddles (as I have done here) and use these to create scenes. Essentially, this is just a particle engine with bouncing particles and collision detection.

Though APE seems to lend itself very well to game development, I am no game developer. However, I do find the possibilities that APE holds very exciting. Here, I have used some basic artwork and added physics and collisions to it, something that could add a dimension to interactive experiments and even website interfaces. For example, it is extremely easy to use custom Sprites or MovieClips as ‘particles’ with collision, so interface buttons or images can become elements in a scene with their own mass, friction and elasticity! Cool.

I use FlashDevelop for Actionscript editing nowadays (which I highly recommend), so have included the project file in the source code. You will also find the Platform Class in there, which will show you how to build your own groups of objects using the APE API. The document Class will show you the basics of creating particles, assigning custom sprites to them and giving them properties which are used when they interact with the environment.

If I have a moment, I will go back and add more functionality, but I hope this demo will at least give an outline as to the potential of APE from a more artistic than mathematical point of view. If you want to know more, you can read the docs here, and download the APE engine here, but be sure to visit the creator’s site and send them some fanmail.

Have fun with it, but go easy on the Gorillas; they’re very irritable…

Download: Playing with APEs
Posted on 24 Nov 2007
3 Trackbacks


Playing With APEs was posted on November 24th 2007 in the category Lab / Actionscript 3.0, Flash and tagged; , , , .

You can Leave a comment.

Warning: file_get_contents( [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 410 Gone in /home/soulwire/webapps/soulwire_blog/wp-content/themes/soulwire/functions.php on line 203


9 Responses to Playing With APEs

Leave a Reply

Pingbacks / Trackbacks

  1. 8 years ago Tuorials | AS3 and Physics « Flash Enabled Blog

    [...] Playing with APES [...]

  2. 8 years ago Simulating Physics

    [...] “Playing With Apes” Example w/ [...]

  1. 3pepe3 9 years ago


    This is really cool, a few months ago i discovered the APE engine and almost immediately i closed the page because i didn’t understand anything about it… I just said that was a nice package.
    Today i understand a lot of more things in AS and with your example and some little more research I’m sure that i will be able to manage this and upgrade my site (that was my first work and introduction with flash).

    By the way you i use the SE|PY actionscript editor and I’m very happy with it… but is there any cool feature on FlashDevelop editor?

    By the way…. in your random function i found that it’s faster to return n>>0 instead of return int(n).
    num>>0 is like the Math.floor() but faster.

    Reply to this comment

  2. Soulwire 9 years ago

    3pepe3, good to hear from you man.

    Yeah, I’ve played with SEPY but not since I started with AS3 (i.e. when I left the Flash IDE altogether), it’s a great tool though. I think many of it’s features it shares with Flashdevelop, really useful things like custom method auto completion, snippets and automatic imports. Also, I love being able to comment my methods and have that comment show up as I implement them from other classes! I guess it’s personal preference though. I like the layout and clean interface of Flashdevelop, but I know SEPY is top notch too!

    R.e. using bitwise shift (n>>0) instead of casting to int, thanks for the tip! I always run thorough speed tests when it comes to implementing things like bitmapdata, but forget the smaller things! I remember reading that int is the fastest numeric datatype, followed by number, then uint. Cheers for the optimisation tip though, and good luck with APE!

    Reply to this comment

  3. Matt Howarth 8 years ago

    How easily could you control the platforms to combine keyboard control with physics? If you wanted them to act as pinball flippers for example?

    Great tute BTW


    Reply to this comment

  4. Andy Roberts 8 years ago

    I got errors – couldn’t find APE_UI and StartTxt. I got the APE demos – CarDemo and RobotDemo to work though. Where are APE_UI and StartTxt?

    Reply to this comment

  5. Soulwire 8 years ago

    Hi Andy,

    APE_UI and StartTxt are MovieClips in the library of the FLA which is included in the download. Make sure you’re compiling from the Flash IDE if you want to use the demo as is. The FlashDevelop project file included is a Flash IDE project, so compile via Flash rather than using the Flex SDK – perhaps that’s why you can’t access the MCs in the library?

    Reply to this comment

  6. Digital Nancy 5 years ago

    Hello, nice article and blog, but you should check some articles for some spam. Just a hint or use Akismet or alike. I’m running it on my blog and it’s really cool! Tschau

    Reply to this comment