corn pops
CornPops Challenge live on MiniClip
This is a rebuild post from last year. The game went live at the end of August 2008. Still going strong though
Big day yesterday, the game I’ve been working on for pretty much the whole of August has gone live on Miniclip. It’s an advergame we built at Digital-Outlook for the Corn Pops cereal.


This was my most advanced game to date, involving a lot of physics. Building it had extreme ups and extreme downs, it really was the summer of physics for me. A nice little bonus was that I have a cameo in the end screen wearing a mullet wig…
I opted to build the engine myself instead of using one of the readily available Flash physics engines like Box2D. The main reason was that I just really like to know how it works and find great joy in figuring out these difficult math & physics problems.
If you ever want to build an engine like this yourself you might want to check out these useful links:
- Elastic collision on Wikipedia.
- 2D collisions explained by Fu-Kwun Hwang
- Ball vs line collisions in Flash
- Verlet integration on Wikipedia
I think one of the main things that caused a lot of gray hairs was the fact that the engine can work well for 15 seconds and then all of a sudden something happens that makes the ball go through something it shouldn’t go through. You really learn to debug properly.
In a nutshell this is how it works:
- define your objects. Walls are a bunch of vectors that go between 2 points. They don’t move. A ball is basically a point with a radius. It also gets a mass for ball to ball collisions. And a rag doll is a bunch of points that need to stay together using Inverse kinematics.
- Once it is all defined you go through your list of objects checking if a collision is about to happen in this frame, the collision detection. You basically want to find out the time within this frame that the collision happens. Let’s say the first collision happens at ‘t=0.4′ (t=0 is the start of the frame, t=1 is the end of the frame). Then you move everything up to t=0.4 in the frame.
- Now comes big step number two, the collision handling. You need to deal with different style collisions in a different way. The options I had in this game were ball-ball, ball-line or point-line. You pick the right one and then you deal with the collision adjusting the speed from the objects in collision.
- Once that is done I have a look if another collision will happen after t=0.4. If so repeat the 2 points above until you’ve reached t=1 and you move onto the next frame.
Now go and enjoy the game over at Miniclip ![]()
Tag Cloud
Blogroll
- Bram Perry Fun with generative art
- Dino Burbidge My inspirational creative director from Digital Outlook
- James Alliban Guy that does cool webcam stuff with Flash
- Nic in Friesland Blog Blurbs and Recipes from the Middle of Nowhere