Courage vs. Cowardice
My final project, the game Courage vs. Cowardice, derives its name from the random variable that influences spaceships to either move up or down as they fly from right to left. As I described in my proposal for this project I originally used this variable with the same name in my Mid-Term project: “Jousting Spaceships.” In that program, the spaceships simply reacted to each other, now they react when they get close to the Stealth Fighter, controlled by the player.
The effect of the “CC” variable makes the spaceships hard to predict and sometimes hard to hit with a missile. Basically in the game the player flies the “Stealth Fighter”, positioned on the left side of the screen over houses while trying to shoot down and dodge alien spaceships that appear from the right. For every spaceship destroyed with a missile the player fires, the player gets one point, which is tracked on the bottom part of the screen. However, the spaceships can destroy the fighter (and end the game) if they crash into the fighter. This will happen if the “CC” variable causes the spaceships to move up or down towards the fighter and the player is unable to get out of the way.
One of the final elements I added to the game was a timer. Once again, I brought back an element from the earlier program “Sunrise Surprise” by adding the sun moving in the background. In “Sunrise Surprise,” the sun, of course, rises. However in Courage vs. Cowardice, the sun sets, moving on to the screen after the game starts from the top. The Sun then heads towards the ground and as it gets closer, the background screen starts to turn from blue to black. Finally, after the sun sets, the background goes completely black. This has the interesting effect of making the Stealth Fighter, which is almost black in color, very difficult to see, a new challenge for the player to deal with. However, after several seconds, if the player is still alive, the level ends with the text: “Level Complete.” One last addition was to add code that actually slows the sun's progress if the player reaches a score of 7.
The game is both easy and hard in terms of playability. The controls are simple: one key, “I” moves the fighter up, one key “M” moves the fighter down. “F” fires the missile. What’s hard is that it is impossible to predict what the spaceships are going to do (since the “CC” variable is random) and if there are several on the screen, which sometimes occurs, dodging them all can be very tricky, particularly since the player can only go up and down. In addition, if the player fires a missile and destroys a spaceship at very close range, the explosion of the missile’s impact can still destroy the fighter. Crashing into the houses on the ground is also another way to die. As of right now, my best score in the game, which lasts about two minutes, is fifteen.
Looking at the game from a programmer’s point of view, I would have to say that I learned quite a lot. It is definitely true that programming a game is a great way to learn how to write code. I feel very confident with my skills in Processing now as I was able to use arrays and objects very effectively while writing the code for the game. In addition, I learned several clever ways to use variables such as “gameState” and “Distance.” Looking back at my progress through the semester, I can definitely see the thread of improvement as I went along creating one program after another.
The great thing is that there is still plenty of room for improvement with the Courage vs. Cowardice game. If I were to continue to work on it, and I might over the break, I can think of several things I would like to add. The first would be a button that would restart the game. The next would be harder levels, which is the reason why I added the text, “Level Complete” at the end. It would be great to have levels in which the spaceships moved faster and/or fired objects at the fighter. I would also like to add different types of spaceships with different abilities such as greater maneuverability and a cloaking device. I also think it would be interesting to add a spaceship that, when it appears on the screen, is beaming something up from the ground, but when the Stealth Fighter gets near, it moves straight up to escape. If the player can destroy this ship, the player would receive bonus points.
So there’s a lot that I can still do, not just with this game, but with others I can invent based on what I’ve learned from this game. The fact that I know how to control objects and the collisions between them opens a lot of doors for me. All of a sudden, those Atari games that I used to play twenty-five years ago now seem to be within my programming grasp and that idea is very exciting. Once upon a time, I thought the concept of creating games was immensely exciting. I’m now beginning to feel that way again and I’ve only just started.
Click Here to Play Courage vs. Cowardice
Game Controls:
I = Up
M = Down
F = Fire missile
Note: As soon as game loads, click on the game screen to active keys. For Macs, click once, for PCs, double-click.