Bridge Cannon

Published August 18, 2007
Advertisement
Last night on the way home from work, I started thinking about making things blow up. The first thing I did was to add a "Explosive" behaviour object that listens for JOLT events from the physics engine to tell it the object it belongs to has hit (or been hit by) something. Behaviours in my engine are control objects you can drop onto things in the game to give them a certain behaviour or characteristic. The idea is that, rather than building monolithic AI logic that requires new code every time you add a new type of thing to the game, there will be a library of small, focused behaviours you can combine and configure to get lots of different results.

Oh, then I had to modify the physics engine to actually send JOLT events out. It already sends out CONTACT and ~CONTACT messages to let you know when you start and stop touching something, but the JOLT message is different in that it indicates when your object has actually hit something, and how much energy was involved in the collision (so you can distinguish a glancing blow that a bomb might bounce off from a direct impact that should make it blow up). I got this mostly working, but wasn't able to find a place I could easily detect situations where you were hit hard, but didn't move (e.g. you're already jammed up against a wall). Still, it's enough to get me started.

At this point, I had my projectiles hitting things and calling a stub "Explode" method which just removes them from the scene, and I started thinking about how I was going to depict explosions. Given I don't even have the start of a particle system yet, I quickly decided I wasn't about to get any explosions working before my train arrived, so I started mucking about with other ideas ... like how much I enjoyed the geometry cannon from a few journal entries back.

Here's a moovie of one of the prototypes. I don't know if I'll end up using it as it has some obvious game balancing issues, but it was fun to play about with and took a grand total of 3 lines of code to implement.

Disabled

Cheers!
Previous Entry Binary
Next Entry Blow me up Scotty
0 likes 1 comments

Comments

Ravuya
That is too fucking cool. You could make a whole game out of spamming geometry and then walking on it.
August 18, 2007 12:54 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Moose Sighting

1329 views

Constraints

1498 views

Moose

1236 views

Melon Golf

1778 views

Toon

1300 views

Spaceships

1051 views

Rendering Pt2

1144 views

Hardware Shaders

1178 views
Advertisement