Saturday, November 20, 2010

Space Invaders Project - Completed

Finally put on the finishing touches, just about everything is done, and I've had a great time doing this. Hoping to maybe convert my Space Invaders game to iPhone/Android app in the future (just for fun).

I had a little fun with my app. I turned the background blue (which looks kind of cool), I switched out some of the art with other art (such as my sons head picture), and changed some of the sounds around a bit.

Great project, great class!

Tuesday, November 16, 2010

Latest update - Almost completed



So I went through the checklist and completed a good portion of the items, I also did a little bit of cleanup as well as changing out some of the images (I liked some of Michael Henson's monster images better).

Right now the only thing on my to-do list for this project is:
- Game Cycle - Return to select screen after game over
- Collisions - Ship laser explodes on hitting top of screen
- Collisions - laser explodes on alien bombs
- Alien Grid - more than one alien can drop bombs at once
- UFO - UFO drops bombs
- Sound - UFO sound
- Sound - better explosion sound
- Shields - Dissolve effect when destroyed

I'll hopefully get most of those done before turning in. If not, it's a fairly functional game right now (I've posted my latest screenshot).

Friday, November 12, 2010

2 Player implemented



Okay, I didn't realize until last class that we were supposed to implement 2 player mode, so I worked on a solution to it. I ended up going with a new object "SpaceInvadersLevel" which held the ship, the enemies, the barriers and all of that. As well as the level the player was on, how many lives, and the score.

If they choose a 1 player game I just instantiate one of these objects, if they choose 2 player I instantiate 2 of them and switch back and forth between them when the player loses a life or goes to the next level (I think that's how it's supposed to work).

Had all sorts of weird bugs with my Laser singleton, but finally figured it out.

A few more things to go and I'll be all done.

Thursday, November 11, 2010

New features!



Okay, new features added today:
- Sound: You can't tell from the picture, but it's there. Currently only the "moving" sound, firing sound and explosions.
- Intro Screen: You can see from the previous post
- Bombs sprite flip: I realized that the bombs are actually a switching sprite too, so I added that.
- Some cleanup, mostly in the level creation areas.

Update


Ok, as you can see I've added the "intro" screen. I just sit there until the user hits "1" or "2" (maybe I should some instructions to let the user know they need to do that).

Currently not doing anything, I just toggle a boolean value, but I don't read the value or anything. I'll need to add "2 players" later on if I get time. I also need to add transitions between the levels. I do have levels, but when they reach "level 2" it just resets the grid and keeps going. Even a laser fired during the end of level 1, might hit an enemy in level 2 if they time it right.

Wednesday, November 10, 2010

Final Space Invaders Spec

The Final specification for the Space Invaders game was given to us today, this adds quite a few things that I need to do to match the spec. The things I need to add to complete all items are:

Select Screen
o Instructions
o High score
o Points for each type of alien
o 1 or 2 player selection
o Credits (optional)

Game Cycle
o Game goes through the following cycles:
 Select Screen
 Instructions/points for each type of player
Select 1 or 2 player Enter Game
Play game until player dies 3 times Cycling between player 1 and player 2
o if in 2 player mode
 Game over screen Update high score if it’s a new high score
 Select screen Return to this screen

Game should be able to
o Each level should get progressively harder
 Initial states: Alien grid position lower to the ground than previous level Alien rate faster than previous level

Score
o High score is updated at the End of Game
 if it’s a new high score displacing the old one.

Player

 Collision:
Missile hits Alien Bomb
o Sound effect on missile launch

Alien Grid
 No one alien can drop more than one bomb at a time  Individual aliens can re-launch bombs
if their respective bomb hits a shield, player’s missile, or ground Aliens can be destroyed by player’s missile
 Music tempo changes as the grid moves faster Adding to the mode and suspense to the game
Launches at random intervals Moves horizontally at top of screen in the right or left direction Launches one bomb at a time


And a few others, I'll add the rest shortly. But just realized I have a lot to do.

Saturday, November 6, 2010

Update - Proceeding nicely



Since last update:

- Added UFO (can be seen in screenshot)
- Added level system (used to just end the game when the last alien had been killed)
- Added a image loader to increase speed slightly
- Added a score singleton so that any object could alter/access score
- Added a 4th barrier
- Cleaned up some code.

So far going well, things I need to still do:
- Sounds
- Barrier 'starbust'

Having tons of fun!

Saturday, October 23, 2010

Tuesday, October 19, 2010

Ship Movement issues - Fixed

Thanks to Sajed and Mike I've fixed some of the ship movement issues that I mentioned in my last posting. I moved the actual ship movement (ship.left(), ship.right(), ship.fireLaser()) into the update loop (instead of in the event handler).

This makes the ship move much smoother but introduces an additional issue. The laser seems to be able to burrow though multiple enemies (and the entire barrier).

It was probably only working because I was doing something inefficiently, and now that I'm doing it right i've got a bug. I'll be working it.

I'll post an other screenshot tomorrow, I've got the different sprites working for the enemies now, and I've got the point model more accurate.

Saturday, October 16, 2010

My Space Invaders vs Real Space Invaders




Tried to alter my HUD to make it match the real Space Invaders as much as possible. The "Credits" and "Score<2>" are just dummy values, as I'm not sure what they would be used for in a modern PC based Space Invaders.

Things that are left to do:

- Sounds, I've not implemented any sounds yet.
- Barrier "starburst" visual flourish.
- Having a difficult time getting the ship to move and fire at the same time. It does work but it's difficult.
- Having a hard time deciding how fast everything should be, the enemies bombs are really fast, and so is the laser.

Thursday, October 14, 2010

Game Design - Part I

Control
* Firing Laser from Ship- Spacebar
* Moving Ship Left - Left Arrow
* Moving Ship Right - Right Arrow
* Pausing - Escape

Scoring Model
I don't fully understand the scoring model of the original game, but I propose the following:
Top Row - 50 points
2nd Row - 40 points
3rd Row - 30 points
4th Row - 20 points
Bottom Row - 10 points
UFO - 100 points
Completing Level - 100 points

Moving Objects
* UFO - Periodically traverses the top of the screen going either from left to right or from right to left. Only 1 present at a time
* Space Invaders - 5 Rows, 11 columns. Move as a group back and forth, dropping down 1 level each time they hit the edge.
* Ship - Moved by the player

Static Objects
* Barriers - 3 static barriers exist, can be destroyed by both enemy and friendly fire.

Wednesday, October 6, 2010

Tuesday, October 5, 2010

Project idea: Size Scroller

I've created a web-page for Size Scoller here: https://sites.google.com/site/sizescroller/home

The brief description:
Size Scroller is a game that gets its inspiration from classics such as Mario Brothers and Braid. Size Scroller is a typical side scrolling action game with a crucial twist. As your hero (Psi) destroys enemies he grows larger in size. As he receives damage he shrinks.

The game is puzzle based, and some obstacles require Psi to be larger (to jump over an obstacle for example), and some require him to be smaller (to duck under a cliff). The challenge is to use the available enemies on the level to manipulate Psi's size, and overcome the challenges.

Monday, October 4, 2010

Space Invaders - Moving along nicely



Okay, as you can see I've got the laser firing, and I've also got collisions going on the aliens. My next things to work on:

- Collision on the barriers
- Aliens dropping bombs
- Scores
- Levels
- Adding more alien sprites (right now I only have the 1 alien with the 2 poses).

Having tons of fun!

Thursday, September 30, 2010

Space Invaders - early stages



As you can see I'm drawing the most of the objects right now. I have the monsters moving in a block. I made a EnemyBlock container class, since they all move as a group and not individually, and I just have the EnemyBlock class contain an array of Enemy objects. The EnemyBlock controls the Enemy objects and the main game only interacts with the block. I also created a Barrier object as well as a BarrierBlock to control the group of 3 barriers. The ship is just moving automatically at this point, I haven't added any keyboard listeners just yet.

Mostly I just wanted to upload my SpaceInvader (looking) screenshot.

Wednesday, September 29, 2010

Homework 3: Completed



As you can see I now have 3 objects bouncing around the screen. The box goes side-to-side, the triangle goes up and down, and the "ball" (I chose a picture of my 1 year old son) bounces around all of the sides.

I've made quite a few changes since the last post. I went ahead and made a MovingObjects superclass and subclassed Box, Ball, and Triangle off of it. This prevented any code-reuse as most of the work is being done in the superclass and the subclasses are mostly just setting environment up.

I have a big aversion to putting any constants in my programs, so I created a MOProperties file that reads in all of the environment (Panel size, object velocities, FPS, etc).

The MovingObjects Panel class was based on the WormChasePanel class. In-fact it's really just a heavily modified copy of the WormChasePanel class, where I took out the irrelevant parts, and added a few pieces that I needed. The MovingObjects main class is also based on the WormChase class, again very heavily modified.

I wasn't really clear on the assignment so I didn't know if we needed to add in any transparency. As such, my triangle and "ball" have white space around them, which can be more easily seen when they overlap. I wasn't sure how to correct this, since we discussed it in class, but not how to actually do it.

Fun assignment, looking forward to working on space invaders.

Saturday, September 25, 2010

Homework 3: Work-in-progress



I started off by simply modifying the WormChase application and replacing the Worm and Obstacle classes with 4 new MovingObject classes. Currently I'm using a MovingObject interface, and just implementing that interface with the Ball, Square, and Circle objects.

I haven't touched the rest of the application yet and I'll probably end up re-writing most of the main-loop stuff shortly.

The image is of the ball and square going up and down/side to side.

Monday, September 13, 2010

Installing Java3D


I went to the link and downloaded Java3D. Once it was downloaded I found the directory where it downloaded to and I realized I already had it from before (probably when I was looking at Java Monkey Engine). First thing I did was open up Eclipse and copy and paste the HelloUniverse.java code into the IDE.

As expected it showed an error, something about permissions on the Java3d Jar file. Okay, lets read the instructions. The Instructions tell me just to run:
> javac HelloUniverse.java

Okay, this works now:

> java HelloUnivese

Okay, looks good. Nice spinning cube. Now why isn't Eclipse working with Java3d? I check the build path and it can see Java3D no problem.

Looked it up online, most people said to manually add the jar file to the project, which I did. I then moved them above the standard library and it worked just fine. Spinning cube in Eclipse as well.

Sunday, September 12, 2010

First Post - Troubles with Perforce

This was my first time looking at Perforce and from first glance it's quite similar to CVS and Subversion.

I can't decide if it's compatible with Eclipse yet, I'll have to figure out how it works with Eclipse another time.

I initially installed it on my PC (running Windows 7) and when I tried to add a file it said "1 warning reported, C:/SE456/test.txt - no permission for operations on file(s)." I messed around with the permissions on my SE456 directory and nothing works. Looked up the error online and several people seem to have had it, but they all typo'ed somewhere or something and got it to work.

Okay, I'm thinking it's a quirky Windows bug, so I switch to my Mac. Same error, can't just be a coincidence, I'm doing something wrong.

Back to the PC again.

Okay, this time I'll pull down the sample file from the Depot. Okay that worked, and it created some additional directories inside my C:/SE456. Okay I'll try to upload into one of those created directories, okay that worked.