Our first assignment in this course was to analyze the game “Space Invaders”. We were suppose to List all the objects in the game and then figure out which properties and behaviors the objects had.
We were also supposed to do a relationship-grid of the object to easier understand how they interact with each other without thinking of the more subtle systems and variables.
Even though “Space Invaders” is a very simple and a game that is rather easy to understand there is a lot of mechanics behind it that can be applied to almost any kind of game.
I figure that this is the whole point of analyzing this specific game.
This is how i analyzed “Space Invaders”
Space Invaders Analyze – Gabriel Ajuwa
This is the SpaceInvaders version i was playing http://www.freeinvaders.org/
//The projectiles does not collide with eachother
//Shieldparts disentigrate from both playerbullets and enemyBullets.
Object: playerModel
Properties: location(x,y) coordinates, graphicsSprite, hitbox, hp,
Behavior: Movement(bounds at the end of screen)
Object:enemy1
Properties: hp, location(x,y), graphicsSprite, hitbox, score
Behavior: movement, firepattern
Object:enemy2
Properties: hp, location(x,y), graphicsSprite, hitbox, score
Behavior: movement, firepattern
Object:enemy3
Properties: hp, location(x,y), graphicsSprite, hitbox, score
Behavior: movement, firepattern
Object:ufo
Properties: hp, location(x,y), graphicsSprite, hitbox, score
Behavior: movement, firepattern
Object:shieldParts
Properties: hp, location(x,y), graphics(three different)
Behavior: Collide with bullets
Object:enemyProjectile
Properties: hitbox, damage,
Behavior: collides with shields, player and the end of screen.
Object:playerProjectile
Properties: hitbox, damage
Behavior: collides with shields, enemies and the end of screen.
Object: screenBounds
Properties: location(screenbounds), hitbox
Behavior: destroys bullets, and stops movement at end of screen
Relation-Grid
Firing System
Input:
ButtonPress(Spacebar)
Process:
if playerBulletOnScreen==True; Unable to Fire another bullet else spawnBullet add position(playerPosition.x+playerPosition.Y+10);
Feedback:
Sound Fx(pew pew)
drawSprite spawnBulletSprite att spawnBullet position
|
Desentigrate System
Input:
If playerBullet collides with enemy
Process:
if spawnBullets position x,y == enemy1 position x,y || enemy2 position x,y || enemy3 position x,y || ufoposition x,y
The hit enemy´s HP -= playerDamage
destroy playerBullet
if enemy´s HP <= 0; destroy enemy
if enemy1 is hit score+=score+10
if enemy2 is hit score+=score+20
if enemy3 is hit score+=score+20
if ufo is hit score+=score+ 50*randomizer 1-6(score goes from 50 to 300)
Output:
remove playerBullet
remove the hit enemy
Feedback:
remove playerBulletSprite from screen.
remove the hit enemySprite from screen.
update score on screen.
SoundFX
Input: if enemyBullet collides with player
Process:
if enemyBullet position x,y==playerPosition x,y
playerHp= playerHp-enemydamage
if playersHp <= 0; destroy player
lifes-=1
if lifes= 0
GameOver();
Output:
remove playerPosition
remove enemyBullet
Feedback:
Lose 1 life
SoundFX
animation is showed at playerPosition
Input:
GameOver
Process:
If lifes <= 0
Output:
AI stops
player loses control of the game (This might be feedback)
Feedback:
show Font on screen
Input:
if playerBullet || enemyBullet hits a shieldPart
Process:
shieldPartHp-=1;
If shieldPartHp<=0
remove shieldPart(hitbox)
Output:
remove 1/3 of the shieldPart that is hit
remove bullet
feedback:
change the sprite of the shieldPart
remove bulletSprite
remove if its been hit three times.
|
Movement System
Input: ButtonPress Left || right
Process: if buttonPressLeft is pressed playerposition-=x
if buttonPressRight is pressed playerposition+=x
Output: Player moves either left or right
Feedback: the player sprite moves either left or right.
|
Bot system
Input: Time passes.
process: some kind of accelerating for loop moving invaders in steps.
the more time that passes the faster they go.
they also fire randomly.
I assume that thier position is programmed with a 5×11 matrix.
if a enemy is shot down they should turn to 0.
enemy1 is a 1, enemy2 is a 2 and enemy 3 is a 3
also if they reach the bottom GameOver() triggers(losing all lives).
output: move the matrix to the right( increase x) then down, then left untill they reach the edge then down and it loops. I assume the matrix looks something like this
3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 0 2 2
1 1 1 1 1 1 1 1 0 0 0
1 1 1 1 1 1 1 0 0 0 0
feedback: they move on the screen
|
Spawn Ufo
Input: Time passes hits a certain Rnd number.
process: if ufo on screen=true ()
else
Randomizes numbers every second and if the number is hit it a ufo will spawn in either top right or top left corner .
ufo on screen=false;
Output: ufo will spawn in either top right or top left corner
Feedback: ufo will spawn in either top right or top left corner
// I assume that i can find almost infinite relations, outputs, feedbacks and processes but the ones listed are the ones most important i believe. Except for a restart system which just reboots the game at its first state.