Friday, April 20, 2012


Chopper Commander : The Final Product


Created by Team Eggstream

Leslie Ducray
Patrick Cummins
Matthew Allen
Craig Hanan
Niall Gaffney








Our title screen menu.




















This in game screen shot shows many of our game features.

In our game we have a paralaxing background , with multiple different layers , moving at different speeds.

1. Our player dashboard displays the players' health , score and fuel.
The player health is a variable of the main player “Chopper1” class .
The player can loose health by being shot by the enemies or by colliding with them.
The player can regain health by collecting the falling health rewards.

Score is increased by destroying enemy vechicles or by collecting falling score (pts) rewards .
The player's fuel is constantly decreasing and so is their altitude.Another challenge of our game is to remain airborne. Falling Fuel canisters are another reward that players can (and must collect).

These results are printed to the screen using sprintfont file and a function Drawtext() and are altered within the different classes where their collision detection applies. For example if our helicopter collides with another helicopter , then the player health is subtracted.

2. Bullets , Our player , the enemy helicopters and the tanks each have an individual bullet class.
6.

3. The rewards is a class , there a three different rewards that spawn randomly on the screen.




Random random;
int i;

public override void LoadContent()
{
random = new Random();
i = random.Next(0, 3);
if (i % 2 == 0)
{
Sprite = Game1.Instance.Content.Load<Texture2D>("Rewards/health");
}
else if (i % 3 == 0)
{
Sprite = Game1.Instance.Content.Load<Texture2D>("Rewards/Points");
}
else
{
Sprite = Game1.Instance.Content.Load<Texture2D>("Rewards/fuel ");
}

They are called randomly , by a random variable (between 0 and 3) being called and modded %
to result in a different reward.
It is set up for Fuel to appear more often than the others.
An alternative could have to been to use switch statements instead.


The rewards are called from the main game ,

private void generateRewards()
{
if (distance1 % 200 == 1 || distance2 % 200 == 2 || distance3 %200 ==3)
{
reward rewards = new reward();
reward.tempIsAlive = false;
rewards.LoadContent();
Game1.Instance.children.Add(rewards);
}
}

The if statement is there to ensure that only 1 reward is called at any time during the game. We have 3 different distnace variable for each of the 3 levels . We worked it out so that while the different distance increment , a reward will only be generated every 200 pixels past.

4&5&6
The helicopters , there are two helicopter classes and an Enemytank (the player's helicopter and the ememy class). All our classes inherit from a gamesentity class such as Sprite , Position , isAlive .
In the player's Chopper class , more variables are initialized such as :

public int Health;
public static int TempHealth;
public int score ;
public static int tscore;
public float fuel;
public static float tfuel;

which records the users statistics. There are also static temporary variables that stay consistant with their counterparts. These variables are used as accessors when interacting within other classes to change the values.

Within each of the object classes , we create a temporary rectangle which mimics the sprite rectangle. This temporary rectangle works the same as the temporary variables , as we are able to use it within other classes. This technique is ideal for collision detection.








 


Level 2
Level 3

7.Another feature /weapon class that the helicopter has is to drop bombs. The bombs kill both enemy helicopters and tanks... as well as the Enemy Boss.


8. In the level 3 , the final level , the Sophisticated Duck that has been observing from the bottom right corner becomes active. He moves up and down the right side of the screen firing .


For our game we did a lot of testing within the labs with class mates , and then also once we were demonstrating our game at the Games Fleadh , we also gained more insight into some issues we would have with the game.

Saturday, March 17, 2012

Plans to continue with Game for Assignment deadline.

We still plan on working on our game to submit as our O.O.P second semester assignment.
We have spotted a few flaws and bugs in our current game that need to be fixed as well as existing functions that need to be polished off.

The Following weeks

The previous few weeks have been spent collaborating our teams individual efforts and trying to polish off flaws in the game.

I had been working on implementing player power ups and rewards such as health , score and fuel.As our chopper's fuel level is always decreasing , a main objective is collecting the fuel canisters to stay airborne.

We gathered the code we had all created and made a single project dividing our work into separate organised classes.
We then together worked on figuring out collision detection , which we had some difficulty with at first. But once we got it working , it was very simple to implement in all cases.
Another challenge the team faced was getting the Enemies to spawn.

We then submitted our game in for the Games Fleadh , where we went down to represent DIT

Tuesday, February 21, 2012

Progress week 1

This week our group start dividing up roles and ideas to research.

I focussed on:
1) a scrolling full screen background.
So far I have been able to get 2 or more images to loop in continuous motion , scrolling from right to left.
the image below is an example of what I have which loops. I have not concerned myself with the quality of the graphics yet , more so on the code concerning them.

2)a randomly generated foreground.
from the image above , we can see at the bottom there is a darker foreground terrain , this has been randomly generated. When the helicopter passes the right x barrier , he will emerge at the same height but back on the left side , and a new foreground terrain will have been generated.

3) scrolling/regenerating foreground for different/progressive stages of the game
4) a drawtext() function for displaying the text
I have so far included text (spriteFont files) to my project to show a dashboard including player lives remaining , the helicopters altitude and distance. As well as text that will only appear once the helicopter has lost all it's lives.

5) controlling movement of playable sprite
I have the helicopter moving with direction , speed using gameTime.ElapsedGameTime.TotalSeconds.
I have not yet introduced rotation .

6) restraints for helicopter sprite on screen
restraints have been put into action keeping the helicopter on screen, or allow the helicopter progression on to new terrains generated by passes through the x>screenwidth barrier.

7) collision detection of sprite on foreground

I have been able to get a rough detection for when the sprite(helicopter) collides with the foreground... but its is still not 100% accurate.
8) displaying text and alternative sprite when helicopter crashes.

Monday, February 13, 2012

Ideas and c# concepts to look at




Adding fullscreen images to our game as a background.

Positioning the sprites and other images in certain places

Draw() function for images and sprites

movement and rotation of sprites. Look and aim (angles) for movement and target systems for firing.
Movement of main character(helicopter) controlled by keyboard and/or xbox controller.

displaying score , health , lives , fuel to game screen(dashboard).

generating a random terrain for the maps which repeated generates and recurs
 throughout playable level , as well as having a rolling or repeating background
 that moves with the game.
Apply a texture or colour to the generated terrain.

Collision detection and consequences , loss of health/lives , increase in score.
methods of detection = matrices / grids / change in colour , colliding sprite rectangles

Adding sound effects at appropriate time.
background music.

animation to movement of sprites.



















The Assignment Proposal


SEMESTER 2 ASSIGNMENT
February 13, 2012
Prepared for: Bryan Duggan

Prepared by:   Patrick Cummins (C10707541)
                 Matthew Allan (C10367153)
            Leslie Ducray (C10327999)
               Craig Hanan(C10318373)
                   Niall Gaffney(C10300999)

The Objective...
For this assignment we can do anything we like, provided that the assignment contains the following:

  • Developed in an OO language such as C++, C#, Java, Objective C, Python
  • Classes
  • Accessors
  • Inheritance
  • Polymorphism
  • Files and strings
  • Collections/generics
  • Encapsulation


The Goals...
Our goal for this assignment is to enter the Games Fleadh XNA competition. The competition consists of making an XNA game of the classic game Chopper Command. We will be writing the code for the game in C#. To enter this competition we have to take the Chopper Command game and put our own twist on the game. We start off with the starter kit that Games Fleadh give you and then we need to add our code to it to make our game. Several regulations need to be followed, are that the game needs three playable levels, each one of increasing difficulty. The game entry can be submitted as 2D or 3D. If we don’t meet the deadline or don’t qualify for the competition because of the vast amount of entries from DIT, we will still be going ahead with the game for the assignment.     





The Solution...
The game concept that we came up with is a game similar to Chopper Command. Our main character is still a helicopter, but we will be putting our own twists onto it, like funky colours, the helicopter being able to drop bombs as well as shoot straight ahead. For the enemies, there will be tanks patrolling the ground that are trying to take down the Chopper at all costs and stop him reaching the next level. Along with the tanks there will be gun turrets on the ground throughout the game, which will also try to stop the Chopper from reaching the next level. The Chopper will obtain a score along the way from shooting enemies, picking up tokens and from completing the levels. He will also have energy and fuel, if either of them run out the Chopper will fall to the ground and he will lose a life. If all lives are lost the game is over and must be restarted. To keep his energy and fuel going, he will have to collect tokens along the way that will top up his reserves. The software that we are going to be using for this assignment is C# for the coding, paintshop pro for all the graphics, with Wav files for the music and editing them with Audacity and FLstudio.   



Contact Details...
Our blogs:
Patrick's Blog
Craig’s Blog
Niall’s Blog
Les's Blog
Matthew's Blog