In March of 1984, ANALOG Computing magazine published a game by Tom Hudson called Planetary Defense for the Atari 8-bit. (Does anyone out there remember this?) This is my take on Planetary Defense.
Here’s a teaser video www.youtube.com/watch?v=zMrPOU6-UKI
You are in charge of protecting your planet from alien attackers. Your only defense is an orbiting satellite armed with two weapons: a charged-particle gun and a missile launcher. To aim, move the targeting crosshairs with the mouse. The left mouse button fires the charged-particle gun, the right button fires missiles.
Charged-particle projectiles travel until they hit something. There is an unlimited supply of them and up to six may be in flight at a time.
Missiles explode when they reach their target (unless they hit something before then). There are 20 missiles per level and up to four can be in flight at a time.
Satellites are destroyed on contact with incoming bombs or flying saucers. You get an additional satellite every 10,000 points.
The game ends when your planet’s core (the glowing dot in the center) is destroyed.
Requirements: Hydra, NTSC TV, two-button mouse.
Installation instructions:
1. Download the attached .eeprom file.
2. Start the Propeller IDE.
3. Type Ctrl-O and open the .eeprom file you downloaded.
4. In the Object Info window, click Load RAM.
5. Defend your planet!
EDIT (attached source archive):
Here's the source. Use at own risk blah blah no warranty blah blah.
Note that I am not including NS_sound_drv_052_11khz_16bit.spin, so non-Hydra people won't be able to build the program (not with sound anyway). Non-Hydra folks, PM me if you want a build with custom clock speed, video pins, etc. and I'll see what I can do. (I assume it's all right to distribute binaries built with NS_sound_drv* -- please correct me if I'm wrong.)
A few random notes on the program:
Cog usage:
1 Spin interpreter
1 rasterizer
3 renderers
1 collision detection
1 mouse
1 sound
---
8 total
The screen is a 256 x 192 bitmap, 2 bits/pixel. The four colors are used as follows:
00 - background (black)
01 - score
10 - planet
11 - explosions
The rasterizer randomizes the explosion color every vblank and changes the planet color every scan line to create the color bands. (The rasterizer also does a whole lot of other stuff in a background task.)
Everything else on screen is a sprite. Sprites take up quite a bit of memory, being high-color (8 bits/pixel) and having a precomputed mask. I traded space for rendering complexity so that my three rendering cogs could give me the performance I wanted.
I was at a loss how to do sound until I looked through Dodgy Kong/HDMF Lite. That showed me the way. (Of course what I came up with is nowhere near HDMF, Lite or otherwise.)
EDIT
Replaced version 0.01 with v0.02 -- corrected teeny tiny boo-boo. Details in thread.
EDIT
Changed video link to YouTube.
Post Edited (mpark) : 4/4/2010 5:16:32 PM GMT



Reply With Quote




Bookmarks