Spiked

rotating_spike

When I was a teenager, I published a video game. It even got a bit of distribution in the kind of free CD-ROMs you used to find tucked into enthusiast magazines. A few people emailed me. Then, I kind of forgot about it. 

One of my servers recently died. As I was cleaning it up and copying over the important bits, I found the old code archives for this game – and I paused to give it a look, not unlike the way you’d flip through a photo album you found while cleaning out a closet. 

The thing is, the game was pretty good. While I’m not exactly proud of the code, it’s nowhere near as badly written or organized as I thought. I’d written gobs of documentation. The game design was unique, and the graphics were good (but by modern standards, very tiny; I was designing for a 640×480 screen). 

I didn’t even know that open source was a thing at the time; I’d released the game as vaguely-worded “freeware” and posted links to the code. (It’s now GPL). 

Spiked is 17 years old. It was written for the old MacOS (pre MacOS X). It requires two people to sit down and compete using the same keyboard. But it’s a thing I made, finished, and published – and that’s pretty cool. The least I can do is give it a small breath of life and write about it; and post the source code on GitHub where it will be (somewhat) immune to bitrot. 

In honor of my younger self, I give you part of the original Spiked documentation I wrote in 1997. 


Spiked 2.1 is a two-player arcade game of cunning, physics, and brute force. One player pilots a green ship, the other player a red ship. There is a horrible, nasty spike that floats around the screen (hence the name of the game, eh?) The only way to die is to touch the horribly, nasty spike. The game follows the gladiator paradigm: the player who walks away alive, wins. So, spike your opponent and achieve victory. Each player starts with three lives. A match lasts between 1-5 minutes, about the attention span of your average computer game player. 

The game plays in a straightforward fashion. The players, the spike, and other items are dumped into a closed arena. Everything interacts with everything else according to the laws of physics. If you bump into your opponent, he/she WILL fly backwards. You can even move the spike if you shove it hard enough (of course, it has 200 times the mass of a player, so it can take a while to build up its momentum). A simple strategy would be to get your opponent between you and the spike, and then you accelerate towards your opponent to shove him/her into the spike. Unfortunately, your clever opponent will probably just move and you will find yourself kissing the spike, which is bad for your health.

spiked-composite

Lots of other things float about the arena. Rocks are massive and basically just get in the way. Ram them to move them. Once in a while, a rift in space opens and deposits either a new rock or a gift.

Gifts make Spiked interesting. These little packets ‘o goodness just float around, waiting to be picked up before they either blow up or are pushed off the edge of the screen. Inside the gift you will find a useful item which can be used to either attack your opponent or get yourself out of a scrape. 

At the top of the screen, you will find an icon representing your ship’s currently selected item. The default item is bullets. At any time, you can press your specified “Use Item” key to either shoot or invoke that item. Or, if you have other items in your inventory, you can cycle through your items to select the item you wish to use. It is always a good idea to build up a small arsenal of items which you use to hunt down and eliminate your opponent or to save your own sorry skin. The items are:

  • Bullets. Each ship is equipped with a small cannon that shoots bullets a short distance. You have infinite bullets, but all they do is push things out of the way. Bullets also destroy gifts, and rocks if you hit ’em enough.
  • Cannonball. This item is really cool. It moves very quickly and shoves things aside. Try blasting your opponent into a spike with one of these! Cannonballs are also a great way to eliminate annoying rocks.
  • Twister. This nasty item prevents whatever object it hits from accelerating. When you hit your opponent with a twister, a energy field clogs their engines, leaving them helpless . Take advantage of them and gently nudge them into a spike. Another use of twisters is to stop gifts which would otherwise float away.
  • Gravitron. Be careful with this toy. You shoot forth a tremendous ³lasso² that drags whatever it hits towards you. This can be really cool if you attach the gravitron to your opponent so that they are dragged into a spike. Of course, if you attach a gravitron to a spike, then the spike will start chasing you and you will probably die. Pity.
  • Speeder. When you invoke a speeder, you rocket forward in whatever direction you are pointed. This provides you with a way to hammer your opponent or to escape.
  • Rockyspiker. If this hits a rock then the rock turns into a rockyspike; or, if it hits a rockyspike, the rockyspike turns back into a rock. A rockyspike is like a spike in that it kills things, but is has far less mass and the rockyspike will blow up if it hits the real spike.
  • new life. You don’t use this gift. You just pick it up. I’ve noticed that people are more than willing to die to pick up a new life, which seems rather odd…

 screen_view

 


 

So there you have it. A 2-player game where the strategy is to manipulate an environment using the physics of randomly presented items. It was written in C++, painstakingly animated frame-by-frame to plug into a 2-d sprite library for which I simulated all the physics, for a now-defunct operating system. 

Not bad, much-younger-me. I need to live up to your example. 

Advertisements

Garden Boxes

My old garden boxes were falling apart; they’d been made from 3/4″ cedar boards that were woefully unable to withstand the abuses of the elements.

old_boxes

The size and location of the old boxes was good, though. There were three 4′ x 4′ boxes, and one 4′ by 8′ box (really, two sub-boxes). 4′ wide is a good size; you can bend over to weed and reach plants easily, and also lumber tends to come in 4′ increments. I already had pretty good, loose soil in place.

old_trellis

 

Also, it had worked well having a built-in trellis for climbing plants like peas and beans. These were positioned on the southwest edge of the boxes so that, in summer when they were covered in a wall of greenery, they wouldn’t shade out the rest of the box.

The last thing that had worked decently well was the strip of copper tape around the perimeter of the box. Slugs and snails don’t like to touch copper. However, the tape had frayed at parts; and as the boards separated, slugs were now able to creep between the cracks in the boards.

Fortunately, removing the old boxes was easy because the wood was in such terrible condition.

The dog approves of removing the old garden boxes

The dog approves of removing the old garden boxes

My plan was to replace the old boxes in-place with new boxes constructed out of sturdier 2×12 lumber; and with sturdier 4×4 posts in the northwest side for a new trellis. I’d use lag screws to stitch things together (bolts would have been stronger and preferable, but would have taken a bit more effort).

plan

I would combine 4′ lengths of 2×12 boards such that, for each board, one end would cap another board; and the other end would be capped. This gives a square shape that’s the size of a 4′ board plus the the width of a 2×12 (because 2x12s are actually 1 3/4″ wide, the total width is 49 3/4″).

In terms of lumber, I decided to use pressure treated fir. Cedar, which is naturally rot-resistant and good-looking, would have been preferable; but it’s significantly more expensive. Pressure-treating helps prevent rot; while I had some reservations about the chemicals used, the lumber yard I use (Dunn lumber) advertises that these boards are safe for people, pets, and plants.

I decided it would be most economical to buy 8′ lengths of 2×12, and cut them in half to give two 4′ lengths. (Also, note that pressure treated lumber is quite heavy; 12′ would have worked too, but is an awkward size and mass to maneuver).

2x12 lumber

8′ 2×12 lumber, on a wet day

Measure to cut boards in half, to 4' lengths

Measure to cut boards in half, to 4′ lengths

Use a skill saw to cut boards in half

Use a skill saw to cut boards in half

Because the pressure treated chemicals are only on the outside the wood, when you cut pressure treated lumber, you should coat the end of the cut with chemicals to preserve the wood. Those chemicals are not to be trusted, and so I would have to be careful to have the cut ends pointing out, away from my garden.

Freshly cut ends expose untreated lumber

Freshly cut ends expose untreated lumber

wood_treatment

 

Brushing wood preservative onto cut ends. Beware these chemicals!

Brushing wood preservative onto cut ends. Beware these chemicals!

Now I had a big pile of 4′ lengths of 2×12 boards, each with one cut end which had been treated with wood preservative. After it had dried, it was time to assemble them into boxes. First, I combined pairs into “L”s, using two 3 1/2 zinc lag screws and zinc washers at for each pair of boards.

I used a power drill to bore holes, then a wrench to screw in the law screws.

I used a power drill to bore holes, then a wrench to screw in the law screws.

Soon, I had many L-shaped boards.

Soon, I had many L-shaped boards. The Helpful Dog approves.

These L-shaped boards were then positioned around the garden beds, and combined to make squares. On the northwest side, I also bolted in two 6′ tall 4×4 vertical posts.

assembled-corner

 

The last step was to finish the trellis portion, so the plants could have something to climb onto. For this, I was going to fit sections of 6″ mesh between the vertical 4×4 poles. 
mesh-1

I cut the mesh with a bolt cutter. I wanted to squeeze the mesh into holes cut into the 4x4s, so the mesh was cut to be a bit wider than 4′. I drilled holes in the 4×4 posts which were 6″ apart, and jammed the mesh in. This turned out to be a pretty awkward project; you want to wear gloves, it’s easy to get poked!mesh-2At last, the project was done! I put horizontal wooden 2x4s (cedar) at the top of the trellis. As a finish touch, I slid glass caps on the top of the 4x4s to add a touch of flair, and also to prevent water from soaking into the top of the lumber.

Done at last!

Done at last!

Fast forward a few months, and you can see that the garden is booming!

final-box