Programs: Spazian and Spazcode Size: Spazian: 1705, Spazcode: 14440 Purpose: Advanced shoot-em-up game for 68K calculators Author: JcN E-mail: judecn@aol.com Please view this in 10pt Times New Roman _________________ Table of Contents I. The Purpose II. Legal Stuff III. The Game Plot IV. The Briefing V. How to change the levels VI. Key Controls VII. Credits VIII. History _______________ I. The Purpose This is my first major 68K assembly game, written entirely in C. It is a shoot-em-up game for the 68K calculators, with 43 levels. The levels are internally modular, and if you want to modify them to suit your needs, please feel free. If you do this, however, please give me reasonable credit. There is more to this game than obliterating entire formations of enemies by buying the best weapon and holding down the 2nd key. This game is designed to make the user make quick, logical decisions, have quick reflexes, invoke their strategical abilities, and pay more attention to the gameplay (or else they will lose). In order to run this program, send "spazian" and "spazcode" to your calc. To play the game, run spazian. Because "spazcode" is large, it is often best to archive it. You can also archive "spazian" if you want. ________________ II. Legal Stuff This game is freeware. It lacks a copyright, a warranty, credits, and promises. The software itself comes "as is." It was your choice to download this program and install it on your calculator. Anything it may cause is not the programmer's responsibility. All of the errors that could harm your calc that would be caused by this program have been removed or fixed to the best of the programmer's knowledge, but that does not necessarily make the game bug-free. If any errors are found in this game, please e-mail the programmer and give as detailed of a description as to what kind of error it was, when it was caused, and what was happening right before the error. The programmer will, in turn, remove the error to the best of his abilities. ___________________ III. The Game Plot In the year 2598 C. E., humans were the lords of the galaxy. It turns out that there were never any extraterrestrial beings smarter or more technologically advanced than humans. Humans explored new worlds, established friendly connections with countless sentient life forms, and kept order in the galaxy, under the command of the United Galactic Directorate. All was calm...until the Snork came. The hive-like entity known as the Snork came from a distant, unknown galaxy. As soon as it arrived in the peaceful Milky Way, it swarmed the outer systems. It didn't just kill off a few unfortunate space ships at the wrong place at the wrong time, but it engulfed entire planets. It stripped every world it came across of all of it's minerals until there was nothing left. As more and more planets were destroyed, more and more Snork vessels emerged from their ashes. The terrified and panicked humans discovered, to their horror, that the entire galaxy was doomed if the Snork was not stopped. Fortunately for them, they noticed the pestilence early on, and hatched a bold plan to save the galaxy from this horrible fate. The United Galactic Directorate quickly assembled a network of an experimental fighters called Spazians. Each one was self-contained, small, quick, and agile, and could be readily upgraded with new weapons and a new invention called ES (energy shielding). Hundreds of thousands were sent to combat the Snork. You (the user) were selected as one of the top fighters. The UGD was able to predict where the Snork would strike next. It happened to be a system with three large, mineral-rich planets at the end of one of the arms of our galaxy. The plan was that the Spazian Team would strike the outermost planet, and move inward until they reached the star in the center where the Snork mind was said to be hiding. Once the strike team destroyed the Snork mind, the Snork Drones would be rendered brain-less and would supposidly shut down. The game Spazian features 43 levels, with 9 types of weapons and ship upgrades, 11 types of enemy Snork drones, 3 World Guardians, and the central collective mind of the Snork itself. It is your job to collect as many upgrades and weapons as possible, destroy all Snork invaders, and (if possible) destroy the Snork mind. _________________ IV. The Briefing A distress signal was received by the UGD from the first planet that was destroyed by the Snork. The person who activated the call (before he was killed) described what was happening to his planet, and the Snork vessels he saw. The UGD was able to provide each pilot with the information given by that brave person. A. The Drones Drones make up the majority of the Snork swarms. They come in all shapes, sizes, and powers. As you progress closer and closer to the Snork mind, you will find stronger and stronger Drones. 1. The Standard Drone #______# ##_##_## This is the simplest and most numerous drone in the Snork hive. ######## It has a no armor, and can easily be destroyed in one direct hit ###__### from any of your standard weaponry. It, like all other drones, ##_##_## delivers a small plasma charge that will decrease the integrety #__##__# of your ES by 1. __#__#__ 2. The Advanced-Standard Drone #______# ##_##_## This is a stronger version of the Standard. It has a small ###__### ES generator to provide it with enough armor to withstand one shot from #_#__#_# the Spazian's basic weapon. #__##__# #______# 3. The Butterfly Drone #______# ##____## This Drone gets its name from its appearance. It has a medium #_#__#_# ES generator that allows it to survive two hits from the ##_##_## Spazian's basic weapon. These Drones have a slightly more ##_##_## advanced weapon system than it's cousins, as it can target #_#__#_# your ship and fire in it's general direction. ##____## #______# 4. The Suicide Drone __####__ ###__### This Drone, along with a few others, have suicidal tendencies. #_####_# They, in addition to having the advanced weapon system, will #_####_# try to ram your ship and make you lose a big chunk of your ES power. #_####_# Be extra careful when dealing with this Drone. __####__ __#__#__ ___##___ 5. The UFO Drone ___##___ __#__#__ Because this Drone resembles a Flying Sauser, the UGD found the __#__#__ name 'UFO' fitting for this Snork craft. This particular vessel _######_ is difficult to hit because instead of moving in a tight circle, ##_#_#_# it tends to move from side to side and use the advanced weapon #_#_#_## system to fire at you from angles. It is often best to use ##_#_#_# the Laser Turret or the Homing Missiles for these Drones. Their ES _######_ integrety varies as the game progresses 6. Standard Defensive Satellite #______# _#____#_ These Drones are remote-controlled weapon platforms that work either __####__ as large groups or as Snork escort ships. They can fire at you with _##__##_ the advanced weapon system, and can withstand several blows before _##__##_ being destroyed. They tend to move in large circles. __####__ _#____#_ #______# 7. Advanced Defensive Satellite #__##__# _#_##_#_ These Drones are a more powerful variation on the Standard Defensive Satellite. __####__ They, instead of encompassing Snork fleets, encompass their enemies (you) ##____## on all sides and fire directly towards you. As they come into view, try ##____## to destroy as much of these as possible before they attempt to engulf you. __####__ _#_##_#_ #__##__# 8. The Rotator Drone ___#____ __###___ These Drones, unlike their cousins, spin in circles as they move. It is ___##_#_ thought that the spinning gives them enough momentum to flee when their _##__### fleet is desturbed. Additionally, they tend to approach from behind and shoot ###__##_ or ram you. _#_##___ ___###__ ____#___ 9. The Scatter Drone ___##___ __#__#__ _#_##_#_ The Drone seen here has heavy armor and a decent weapon system. #_####_# It too has suicidal tendencies and will try to ram your vessel. Try to take out #_####_# as many of these as you can when they come into view, as it only _#_##_#_ takes three of them to destroy your ship (unless you have the ES __#__#__ upgrade, but then it is only six) ___##___ 10. The Missle #__##__# ##_##_## These are not really Drones, but are missles launched at you from the _######_ Missle Defence Network near the Snork mind. In addition to packing a __####__ good punch to your ship upon impact, they have advanced weapon systems __#__#__ to push you closer to them or to other missles. Fortunately, they are __#__#__ lightly armored and can be destroyed in three direct hits from the __#__#__ basic Spazian weapon. ___##___ 11. Asteroid _######_ ##__#### There is an entire field of these between you and the Snork mind. #__##### Unfortunately, the Snork Swarm decided to plant plasma cannons on #_###### the asteroids to shoot at you as they pass. Also, some of them have ######## engines to move closer to you to either shoot at you or ram you. ######## These are very, very strong in armor and will destroy you in one or ######## two impacts. _######_ 12. Guardian Drone __#__________#__ _##____##____##_ These are the most powerful Drones in the entire Swarm. They _##___####___##_ accompany several fleets of Snork vessels, and usually remain #######__####### at the rear of their Drones. They have the advanced weapon system, #######__####### and have an improved verson of the Snork plasma cannon which does _##___####___##_ twice the damage upon impact with your ship. Also, they are heavily _##___#__#___##_ armored, and the ones closer to the Snork mind have increased shields. __#____##____#__ Fortunately, there are only a few of these in the Swarm. In addition to this formidable set of Snork Drones, there are at least three extremely powerful vessels called "World Guardians." There is one of these per planet, and they are thought to oversee the destruction of their planet. Very little is known about World Guardians, but the UGD does know that they are heavily armed, extremely agile, and have exceptional armor. Even less is known about the Snork mind, which is held on the Snork Flagship. It supposidly can synthesize new enemies to guard it, as well as fire extremely large plasma charges at your ship. Once you destroy an enemy Drone, some of it's minerals and energies may linger. On your screen, they show up as Hearts and circumscribed C's (C's with circles around them). The Hearts are small quantities of energy that recharge your ES by one unit. The circumscribed C's are small amounts of rare elements that can be exchanged for Galactic Credits. Each one is worth about 100 credits. Your ship has a miniature tractor beam that will haul the resources into the ship's storage compartment. Energies will become part of the ES as soon as it makes contact with it. The minerals will be stored in the ship's cargo bay. Unfortunately, Weapons 1 to 3 (see the next few paragraphs) can destroy the energy or minerals if they make contact with it. The others are called "Safe Shots" because they will move underneath the prize when they near it and continue on their original vector pattern, avoiding it altogether. If you shoot a resource, it may be restored (this rarely happens) or become another resource because the shot may simply rearrange the molecules instead of obliterating it. Do not rely on this very much, because the shot has to be in just the right spot at just the right time. If your ship's ES and armor fail, you and your minerals will be captured in the tractor beam of a replacement ship. There are five per pilot of your status. The number remainig is indicated by the heart and the number next to the primary shield bar. You and your minerals will be placed into the replacement ship and your shields will be returned to the default level. Additionally, all of your weapons will be retained by the tractor beam and re-integrated. If you lose your last replacement ship, you are no more than dust in the void. Do not feel overwhelmed, for your Spazian ship is quite powerful. As soon as you capture enough rare minerals, the weapon bar selector advances by one notch. A picture of the weapon or upgrade becomes visible underneath the weapon bar. When this happens, you can transport the minerals in the cargo hold of your ship back to HQ via teleportation, and they will send you the weapon or upgrade that you requested. Here's a brief description of each: Weapon 2: Plasma Bomb This weapon is an improvement over your basic _##_ weapon that came with your ship. It has double the #### power. #### _##_ GigaBlast This is a limited weapon that delivers a powerful ___##___ magnetic charge in a single direction. It's potentcy ___##___ destroys all space vessels in its path by interfering ___##___ with it's armorment systems. The number of GigaBlasts __#__#__ onboard is indicated by a picture of a GigaBlast and a __#__#__ number in the lower right hand corner of the screen. They ___##___ are deployed with the Alpha Key or the Mode Key. ___##___ ___##___ Weapon 3: Dumbfire Rockets This is triple the power of the basic Spazian weapon. __##__ It randomly fires in one of three directions: _#__#_ Left _####_ Foreward #_##_# Right It is useful when dealing with enemies that are spread out. GigaBombs This is a rather unusual weapon. When it impacts an _####_ enemy Drone it explodes in such a way that it creates ##__## a large shockwave that destroys all enemies within a #_##_# particular radius of the explosion. World Guardians #_##_# are said to be resistant to this weapon. The number ##__## of GigaBombs is located in the lower left hand corner _####_ of the screen by a picture of a GigaBomb followed by a number. You can only fire one of these at a time. They are deployed with the Diamond Key or the Catalog Key. Weapon 4: Safe Shot Missile This is the first and least expensive "safe shot." It will not _##_ destroy resources if it nears them. It does four time #### the damage of the basic Spazian weapon. #### #### Extra Shields This is an ES upgrade. It doubles the amount of shield ##____## power for your ship by allotting your craft an additional ######## shield bar. It can be recharged in the same mannor as the #__##__# as the normal shield bar. ######## Once it runs out, there is no way to ######## get it back unless you buy another one. Additionally, when _#_##_#_ you buy this upgrade, it recharges your primary shields as well. __#__#__ ___##___ Weapon 5: Antimatter Disk This weapon is comprised of a flattened disk that is immune _#######_ to plasma balls from enemy Drones. In fact, enemy shots will #_______# hit this weapon shot instead of pass through it. Additionally, #_______# this weapon does five times the damage of the basic Spazian _#######_ weapon. It is often best to use this weapon as a shield for your ship if you are low on shields. Weapon 6: Homing Missile This weapon allows your Spazian to launch heat-seeking missiles. Once _##_ the missile leaves a launch tube (on either side of your ship), #### it chooses an enemy location at random and heads in that direction. #### The drawback is that if the enemy moves away from this spot, _##_ the missle will not compensate for its change in position (otherwise _##_ the game would be too easy to beat). Additionally, because these missiles #### seek engine heat, they have trouble finding a single enemy because they #### do not give enough heat for the missle to find. If it cannot find a #__# target, it behaves like the basic weapon by firing straight foreward. It does six times the damage of the basic weapon upon impact. Laser Turret There is a good reason why this weapon is so expensive. A 360-degree ___#___ rotating turret at the nose of your Spazian is added when you buy this weapon. __###__ It almost always hits an enemy and does 4 times the damage of the basic _#_#_#_ weapon. However, it does not target Guardian Drones or World Guardians. ####### It is fired with the Shift Key. _#_#-#_ __###__ ___#___ So, as you can see, your experience in combatting the Snork Swarm will be...interesting, especially if you are not used to this type of gameplay. When you accepted the mission, you probably took a look at the game options. There, you probably looked at the Difficulty menu. The three difficulties are (what a surprise) Easy, Medium, and Hard. This refers to how far away your course will be from HQ. The further away from HQ, the more minerals it takes to advance the weapon bar selector (after all, some of these minerals are used to power the teleporter inside your cargo bay). If you decide that your current difficulty setting is too hard, then you can always change your course so that you will be closer to HQ. However, you will lose points. ____________________________ V. How to change the levels Soon, I'm going to find a way to allow the user to create external levels. For now, you have to change the built-in levels. I'm assuming that you are a TIGCC programmer with decent C programming skills in this section. If you create a modified version of this program, and it crashes on you, it is not my responsibility. If you need help avoiding crashes when creating a modified version, the programmer will be willing to respond to an e-mail. Toward the end of the middle of the code, there is a function called "levels." You will notice that it accepts a variaty of arguments (mostly in the form of a pointer). Here's what it looks like: void levels(int (*entype)[], int (*enx)[], int (*eny)[], int (*enmove)[], int (*enshiftx)[], int (*enshifty)[], int (*enceiling)[], int (*entemp)[], int (*enshield)[], int levels, int *bosslevel, int (*enshotflags)[], int (*sblevel)[], int clevel) There are nine arrays that control a single enemy: (*enx)[] This stores the enemy's x-coordinate (*eny)[] This stores the enemy's y-coordinate (*entype)[] This stores the enemy's type (*enmove)[] This stores the enemy's movement pattern (*entemp)[] This is a temporary array used by the movement algrithms. It is usually set to 0. (*enshiftx)[] This stores the enemy's x change. (*enshifty)[] This stores the enemy's y change. (*enshield)[] This stores the enemy's shield power. (*enceiling)[] This stores the maximum amount of moving space an enemy has. It stores the maximum y cooridinate the enemy is allowed to move to. There are additional arguments here as well. *bosslevel If this is set to one, the program will initiate the shopping sequence before the level starts. level This determines which data to be used for the next level (see the code below) clevel This is used to determine which World Guardian to use (it stores what world the user is in). (*sblevel)[] This array stores the flags for a World Guardian. Depending on the value in clevel, the 0th, 1st, 2nd, or 3rd term will be occupied by a value which corresponds to the "drawenemy" function. (*enshotflags)[] This array is used in the "moveenemyshots" and "exchangeblows" function. It determines whether or not an enemy shot exists, and what type. In some of the levels, this array is filled with -1 to prevent the enemies from firing altogether. This is what the first level looks like: if(levels == 1) { for(i=0; i<20; i++) { (*entype)[i] = 1; if(i < 5) { (*enx)[i] = (25*i) + 20; (*eny)[i] = -155; (*enceiling)[i] = 10; } if(i >= 5 && i < 10) { (*enx)[i] = ((i-5)*25) + 20; (*eny)[i] = -140; (*enceiling)[i] = 25; } if(i >= 10 && i < 15) { (*enx)[i] = ((i-10)*25) + 20; (*eny)[i] = -125; (*enceiling)[i] = 40; } if(i >= 15) { (*enx)[i] = ((i-15)*25) + 20; (*eny)[i] = -110; (*enceiling)[i] = 55; } (*enmove)[i] = 1; (*enshiftx)[i] = 0; (*enshifty)[i] = 1; (*entemp)[i] = 0; (*enshield)[i] = 1; } } You will notice that there are 21 terms in each of these arrays, but the for() loop is only set to go as high as the 19th term. This is because the 20th term is saved for a Guardian Drone, as you can see at the end of level 3: //configure boss (*enx)[20] = 0; (*eny)[20] = -50; (*enmove)[20] = 10; (*enshiftx)[20] = 0; (*enshifty)[20] = 1; (*enceiling)[20] = 4; (*entype)[20] = 100; (*enshield)[20] = 20; (*entemp)[20] = 0; Additionally, the World Guardian uses the 20th term in the arrays. For example: //configure subboss for(i=0; i<3; i++) { (*sblevel)[i] = 0; } (*sblevel)[clevel - 1] = 1; if((*sblevel)[0] == 1) (*entype)[20] = 1000; if((*sblevel)[1] == 1) (*entype)[20] = 2000; if((*sblevel)[2] == 1) (*entype)[20] = 3000; if((*sblevel)[3] == 1) (*entype)[20] = 4000; (*enx)[20] = 50; (*eny)[20] = -50; (*enmove)[20] = 20; (*entemp)[20] = 0; (*enceiling)[20] = 20; (*enshiftx)[20] = 2; (*enshifty)[20] = 1; (*enshield)[20] = 60; This is pretty much how the level system works. Depending on the number stored in the arrays, the program will act accordingly. Here's what you can put into the arrays to get a valid output: -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Array | Input | Output --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- (*enx)[] | Any whole number between | Enemy, when on the screen, is put at | 1 and 160 (or LCD_WIDTH) | that x location. The enemy will only be displayed if it is within the screen boundries for X | | (*eny)[] | Any whole number | Enemy, when on the screen, is put at | | that y location. The enemy will only be displayed if it is within the screen boundries for Y | | (*entype)[] | Any whole number between | Enemy of that type is displayed | 0 and 9, or 20 and 21, or | | the numbers 100, 1000, 2000 | | 3000, or 5000 | | | (*enmove)[] | Any whole number between 0 and | Enemy follows the corresponding movement pattern | 7 | | | (*enceiling)[] | Any whole number between 1 and | Enemy goes only as low as that location, | LCD_HEIGHT | and no lower | | (*enshield)[] | Any whole number greater than 0 | Enemy takes that many decrements in shield to be destroyed | | (*enshiftx)[] | Any whole number between -1 and | Enemy X position changes by that many pixles | 1 | | | (*enshifty)[] | Any whole number between -1 | Enemy Y position changes by that many pixles | (usually only 1 in the levels | | function) | | | (*entemp)[] | Usually 0, unless you create a | This is used only by movement algrithm functions | new movement algrithm | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If you play the game for a while you can determine to what the numbers correspond. If you have trouble doing so, please inform the programmer and he can assist you. If you want to change the sprites in the game, they are all defined as static arrays at the beginning of the program. I defined them in binary instead of hex for your convenience. If you want to change the movement algrithms, they are after the exchangeblows() function. movealgrithmn1() controls the resource movement, the rest control enemy movement. If you want to have a copy of the program's custom menu system, it is located after the levels() function. It consists of three functions: gamemenu() menu() drawbox() The programmer will explain how they work or how to implement them if you e-mail him. If you desire explainations for any other function, please e-mail the programmer and he will tell you what you need to know as soon as he can. ________________________________________________________ VI. Key Controls (should be the same for all 68K calcs) A. Game Menu Enter: Select item from menu B. In-Game Controls 2nd: Fire standard weapon Diamond/Mode: Deploy GigaBomb Shift: Fire Laser Turret (if you have it) Alpha/Catalog: Fire GigaBlast Arrow Keys Move ship Home: Bring up Game Menu Clear: Quickly exit Spazian (avoids menu) F1: Select item from weapon bar Esc: Activate "Teacher" mode Apps: Deactivate "Teacher" mode C. Shop Controls Enter: Purchase an item Esc: Exit shop _____________ VII. Credits A. www.technoplaza.net Their tutorials helped A LOT. Thanks guys! B. Philip Shirey (Phil Software) His help with pointers and arrays saved a lot of memory on the game. Also, he helped debug the program, and basically allowed this game to become possible. Thanks a bunch, Philip! C. Joseph Murry and Luke Nelson They tested the program and gave advice to make the game more enjoyable and interesting. D. Vincent DelVecchio He is my computer teacher and he showed me how I could avoid using tons of global variables. He also helped me understand the principles of OOP. E. The Public Believe it or not, I get all of my bugs squashed out of the program when you report them to me. Also, I get new ideas from the public. Thanks to everyone who e-mailed me with suggestions, comments, and bug reports. _____________ VII. History Version 0.25 -changed some key configuration errors with V200 -added "Teacher" key -fixed bugs in 0.200001 Version 0.200001 -fixed some bugs in 0.2 Version 0.2 -compressed the program -reconstructed the graphics system -added weapon bar -removed shop -changed usage of extra shields -changed Snork -added more options -reduced the size by declaring sprite arrays as local variables -encapsuled sprite arrays into array pointers for easy access -added some shield power to Hearts and Credits -changed background sprites -squashed a few bugs (in the program and in the README) -now theoretically compatable with TI-92+ and V200 Version 0.100001 -added this file Version 0.1 -first beta release