Impatient? Click to play Digg Attack! (read the intro screen for instructions) or keep reading for details and background.
This is something I started a good while ago but only just recently got into a playable state. The goal was to create a small game where the action is based on an external data source. It turns out that the Digg API fits that bill fine as it provides both varied data and a steady stream of it, and thus the product, in its current state, is an unusual 2D shooter where the flow of enemies is based on stories that are "dugg".
The protagonists come in the form of a small flock of social media heroes, controlled by targets set by the player and influenced by various objects on the map. They are also somewhat autonomous as they use simple flocking mechanisms to stay close together and move as a group.
With the exception of the music, it uses only the Canvas element and regular DHTML and another goal was that I wanted it to feel "fluid" and be able to compete with similar Flash games, even when there was a lot going on on the screen. I think it meets this goal just fine, at least when played on a moderately sized box. I also know there are some decent optimizations to be done in there once I get around to it (ie. the explosions could be prerendered rather than dynamically created as they are now, etc.) On the sound side there is currently only background music. I had some sound effects going on with SoundManager2, but it's giving me a bit of trouble, so I've sort of abandoned them for now. Also, apart from the vortex sprite and the prerendered text, all the graphics are created at runtime with Canvas drawing.
Ok, get on with it!You start each level with a number of heroes (ie. little blueish dudes). The game connects to Digg.com and as stories are dugg, enemies are spawned and enter the screen from either the left or the right side. The type and number of enemies spawned depend on how many diggs the story has received:
6-50 diggs: Antiheroes, similar to your heroes, but red (and evil!) Spawn in flocks of 2-7 antiheroes. These guys are small and weak but will nevertheless actively and tirelessly hunt your heroes.
51-500 diggs: Predators, larger and more dangerous. Coming in packs of 1-3 predators, these also actively hunt your heroes but are easier to out maneuver. Their larger size more than makes up for this, however.
501-infinity diggs: Biggies. Huge, slow and not very bright. These enemies wander around with no aim, just bouncing about the level. Are tougher to kill than the others, but move slowly.
The goal is to survive - or at least try to - for a number of seconds (typically 60-120) before you autmatically proceed to the next level. If you are so unfortunate as to lose all your heroes (chances are good that you will), reinforcements will be sent in at the low, low cost of 25% of your currently accumulated score.
Don't worry if you keep dying almost immediately, just try again and the next round might be more forgiving. The difficulty varies in time due to the unpredictable nature of the data the enemies are based on. You might be unfortunate and run into a stream of high/medium profile diggs and be flooded with strong enemies, or you might be able to just cut your way through small groups of antiheroes for most of the level.
The levelsAs each level has a fixed amount of time, the ultimate goal is to get the highest score by the end of the last level. At present time there are a total of 12 levels with a combined game time of 15 minutes and 10 seconds.
The first level is just an empty playing field. Later levels feature blocking structures, attractors/deflectors, zappers and even small black holes. Here's a quick overview of what you could be facing:
Blocks: These are simple impassable structures that block your path and/or divide the map in smaller sections.
Directors: When you come in the range of a director, your heroes will feel a sudden urge to move in the direction of the arrow. They come in 4 flavours: up, down, left and right.
Attractors: Much like the directors, these also affect your heroes' senses of direction but rather than make them move in a specific direction, your heroes are compelled to move towards the center of the attractor. Be careful as it can be hard to escape once you've become trapped.
Repulsors: The twin sibling of the attractor, the repulsor does the exact opposite and make your heroes move away from the point of repulsor.
Zapper: High powered electrical menaces that make short work of your magnificent heroes. Come within range of one of these bad boys and one of your heroes is sure to be toast. Fortunately it takes a second before the zapper is ready again.
Vortex: Gravitational pull will drag your heroes to the midst of these miniature black holes where nothing and everything meet and the very fabric of spacetime is torn apart (that includes your heroes).
Except for the walls and blocks, the enemies are not affected by any of these map objects.
- The enemies go for the collective (average) center of your heroes. You can exploit this by spreading your heroes out over the entire map.
- Even if you can't move through blocks, you can still shoot through them.
Mostly tested in Firefox 3 but looks to be working in Opera 9.6 and Safari as well. If you get graphical glitches in Safari, try with a recent WebKit nightly. IE is of course a no go.
So, there are still a bunch of outstanding issues and stuff, but mostly it plays well. Actually, I'm not entirely satisfied with the gameplay yet and would like to evolve it a bit but I'm not sure in what direction. The whole "external data" part is up in the air as well. If you have any suggestions for changes, bug reports :( or just want to comment, please do so below. And post some high scores, even if you don't bother finishing all 12 levels!
There have been reports of issues with Linux and I think it might be related to nVidia cards, so if you're having problems with Linux and have a non-nVidia card, please leave a comment below.
The general rules and the details about how to control your heroes are described on the intro screen, so make sure you read it.
Click to play Digg Attack!
And if you like it, why don't you...