Top Banner
Unit 22 – Developing Computer Games ASSIGNMENT 2 PHILIP ABRAHAM
30

Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Aug 24, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Unit 22 – Developing Computer Games

ASSIGNMENT 2

PHILIP ABRAHAM

Page 2: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Produce a design for a computer game for a given specification.

The NarrativeThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots other rockets. The purpose of the game is to have a rocket ships which shoots other ships and destroys them. The rocket ship uses weapons to shoot the other rocket ships down

These are going to be the controls that I have created to control the game.

This instruction code will explain how the world is created and what it does.

These are just some of many examples of pseudocode that is used during the game.

Flow Chart

This is the flow chart that is going to show how the game functions and what happens if thing happen during the game or not.

PAGE 1

IF mouse is moved upwards then Rocket direction moves upwards

IF the mouse is moved downwards then Rocket moves downward

IF the mouse is moved to the right then Rocket moves right

IF the mouse is moved to the left then Rocket moves left

When the world is created, insert Rocket into the middle of the world

When game is started, Enemies are spawned in random location and order

When laser hits the enemy, enemy is then destroyed

When enemies are spawned, Rocket shoots lasers automatically

Page 3: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

PAGE 2

Start Game

Game running

Rocket Moved

Rocket Hit

Enemy hit

No

Yes No

Game Continues

Game Over

Yes No

Yes

Page 4: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Action ListThis is an action list which shows what certain actions do to the game. This is very important in the game if you want to understand it more.

Action EffectUser clicks to Start Game The Rocket ship is created and enemies

start appearing randomly.Rockets laser hits enemy The enemy rocket explodes.

Rocket is hit by enemy The rocket ship explodes and the game is stopped

User moves mouse upwards Rocket ship moves upwards User moves mouse downwards Rocket ship moves downwardsUser moves mouse left Rocket ship moves leftUser moves mouse right Rocket ship moves right

Story Board

PAGE 3

Scence Game over

Rocket Ship DestroyedRocket destroys enemies

Scene: Game over Scene: Game Start

Page 5: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Graphical UI Tools

This is what the game looks like. This game is controlled by a mouse and not a keyboard. Wherever you move the mouse the rocket ship will go. The rocket ship will shoot the laser automatically.

Developing a computer game for a given specification.This is the evidence for the game I have made on Greenfoot. I will screenshot the code and explain what the code is for and how it affects the game. The game design is based on the plan that I made in the previous tasks.

PAGE 4

Page 6: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

This Screenshot of code is to show how I created the world. I created the world so that it is 900*800 pixels.. In this screenshot it also shows that I have put a function which adds a rocket ship to the world.

In this screenshot I have chosen to add another object which are the enemies. It also shows that the enemy will be spawned in a random location. There is also a time delay on when the enemies will spawn.

PAGE 5

Page 7: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

This screenshot is for the Rocket’s code. This piece of code shows where the rocket will be spawned and its location. The classes are implemented at the beginning of the code so that the rest of the code can work.

This part of the code is also for the rocket. This is the code that determines the controls for the rocket. The code written shows that the rocket will follow the mouse’s position to move. In the very last part of the code for the rocket ship it shows that there is a new object that has been declared. That is the laser that the rocket will be shooting to destroy the enemy ships. There is also a time delay for the laser being shot.

PAGE 6

Page 8: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

This screenshot of code is for the enemies. This piece of code shows where the enemies will be spawned. The enemies will fly towards the users rockets. At the beginning of the code for the enemies are the classes that have been declared.

PAGE 7

Page 9: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

This is the code that shows that if the enemy is destroyed that it explodes in many fractions looking like it has been destroyed to bits. The code also shows that if the enemy hits the rocket the rocket should destroyed.

This piece of code is for the laser. At the top of the code the classes are implemented. Image.setColor is used to set the colour of the laser and the laser colour has been set to red. The code also shows that if the enemy is hit by the laser that the enemy should be destroyed. If the enemy is destroying the code tells the game to remove the enemy.

PAGE 8

Page 10: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

This is the code for the circle. The circle is a piece of the rocket and enemy that appears as debris when the actors are destroyed. In this piece of code, it shows what the colour of the circles should be.

This piece of code is for the fractions which are part of when one of the rockets or enemies are destroyed.. The last part shows where the rotation of the fractions should take place. After the fractions have appeared the last part of the code says to remove it completely.

Determine appropriate data types for a computer game and show how they are declared

These data types are used in the program design and data representation. These are things that I used inside my game

PAGE 9

Page 11: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Purpose

The purpose of the game is to be a game where a rocket ship shoots other enemies.

Program Design

The program design is to shoot enemies with my rocket using a laser. The code in the game is very easy and simple to modify.

Modularity

Modularity enables other parts of the game code to be reused. This means that you can use the same code multiple times inside the same code.

Data Types/Structures

Data types and structures means that your data will be more specific and your code with will be given structure.

Data dictionary

The data dictionary is a collection of description for all the functions that are used during coding.

Methods/Procedures

A method or procedure is an instruction which is run so that the codeworks in a certain way. That is why it is called a method or a procedure.

Systematic Approach

A systematic approach is when you write things correctly inside the code for it to work. You must also declare classes and you must also write the code in the correctly.

Return Values

Return values are mathematical equations. An example of return values is 6*6 which will give you 36. That is a return value.

Parameters Passed

Parameters passed is when the code functions properly. When the parameters are passed it allows the code to function properly.

Scope

The term scope is used to describe where the program or objects inside the code can access the data that is available to it.

PAGE 10

Page 12: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Private

Private data means that the data can only be accessed where the data has been declared and only in that part of the code.

Visibility

Visibility in the code means that you can see the code whether it is private or public.

Public

Public data means that the data can be accessed in any part of the code whether it is in the Rockets code or in the enemy’s code, it can always be accessible anywhere in the code.

Static

Static data types are pieces of code that runs throughout the code until the end of the program.

Friend

A friend function has access to public and private data types the same as any method during the program.

Objects

Objects are pieces of code which have a particular purpose. The laser in the game is an object which has a particular purpose

Instantiation algorithm design

Instantiation is the making of the class, object or a computer process. This enable the code to work properly.

Develop

To develop is to create a program while looking at the details and design of the program.

Development facilities

I have used Greenfoot to create this game. I have also used my own computer and the internet to help me develop this game.

Choice of languages

I have chosen to use Java to create this game.

PAGE 11

Page 13: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Menus

Menus allow you to chose different options in a game. I haven’t used that in my game because I haven’t felt the need to implement it.

Editing techniques

Editing techniques are ways that you can change many things in a program. For example, you can change a picture without it changing the code.

Saving Files

Saving files is very important because it means that you wont lose the data or programs.

Built in help facilities

When you need to understand or find a specific function you can open the help menu which has multiple functions that you can use in your code. This is a built in facility.

Building and compiling code

When building code, it is important that you build the code correctly so that it functions as it is supposed to. Compiling Code is very important because it means that the code needs to be correct or it cannot be compiled.

Good programming practice

Good programming practices are very important when your code is not only going to be used by yourself. Using code comments makes it easier to fix mistakes in the program or to edit the code.

Small unitary

This means that that the pixels can be modified accordingly to what the user wants it to be.

Invocation

Invocation is calling or using a function in the code and the program.

Descriptive Identifiers

When you want to change a parts in the code, descriptive identifiers will help you identify the piece of code you want to change. They could be comments to tell you what that piece of code is.

PAGE 12

Page 14: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Consistent indentation

Indentation is the space before code is written. This also means that your code is easier to edit because you can find your way around the code written.

Use of programming structures

Programming structures are important because your code needs to be structured correctly and code shouldn’t be stuck together or it will unreadable.

Operators input and Output

Input and output is very important in coding because there will always be an input needed and an output will always be there to be given or used by the user.

Assigning values

Assigning values is very important when you are declaring variables in your code. If you do not assign a value to your variable the code will not understand how to represent it.

Syntax rules

Syntax rules are very important in coding. Each programming language has its own syntax rules and if they are not respected the code will not work.

Selection methods

Selection methods are very important in coding because when your code is running it chooses the code that it needs at the time when running.

Iteration loops

Iteration loops are when programs which are repetitive, iteration loops are important because they repeat the same thing over and over.

Post conditioned

A post condition is a condition that is proved true after the code is run.

Fixed

A fixed loop is a set of instructions that is run for as long as a condition is met or until it is told to stop.

Data representation types:

An integer is a number that has no decimal point but can be positive or negative.

PAGE 13

Page 15: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Real number

Real numbers are including all whole number without decimal points.

Booleans

True and false statements are examples of Booleans always used in codes.

Characters

Characters are values such as letters, numbers and symbols that are imputed by a keyboard.

Strings

Strings are words or sentences. Strings are mostly used when you are making sentences in your code.

Declaring

Declaring variables are what makes the system recognize what they are and how to use them.

Variables

Variables are parts of the code which can always be changed.

Follow a test strategy to test and debug a computer game and use a variety of test tools I have done 2 types of testing Blackbox testing and Whitebox testing. Black box testing is when other people try my game and they found issues and difficulties. White Box testing was done by me because I can see the code and I can see what is going wrong with the game.

This is a very efficient way of testing games because if gives you a visual on how good your game is and if it needs improving. It is also a good way to debug games making it run smoother and easier. I have created a table explaining the reasons or the test, the expected results and if there is a possible fix. I have also attached a photo on each test to prove that I have actually tested my game.

Test number

Reason for testing

Expected Results

Results Shown

Possible Fix

PAGE 14

Page 16: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

1The game should start.

The Game should start without problems.

The Game started with no issues.

N/A

2The game should reset.

Once reset is pressed game should reset.

The game resets with no problem at all.

N/A

3When mouse if moved rocket should follow.

The mouse should be able to control Rocket.

The Rocket followed the mouse and done what it needed to do

N/A.

4 Rocket should destroy enemies when enemies are hit with laser.

Laser should destroy enemies when hit.

Enemies are destroyed once they are hit with laser.

N/A

5Rocket should be destroyed if hit by enemy.

I rocket comes in contact with enemy rocket should explode.

Rocket is not destroyed when enemy hits it.

I should modify the code so that when rocket is hit by enemy it is destroyed

6Enemies should spawn randomly.

Enemies should spawn in different areas.

Enemies spawn randomly.

There is no need for a fix

PAGE 15

Page 17: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

7Game should stop when rocket is destroyed.

Game will stop if hit by enemy and destroyed.

Game does not stop when rocket is destroyed.

I should modify the code so that the game will stop when the rocket is destroyed.

8A Game over sign should appear once game is over.

The Game over sign should appear when game is over

The game over sign never appears even after the game is over.

I should add a new actor which will be used when game is over. It will show GAME OVER.

Use appropriate selection and iteration methods for a computer game Iteration is very important because it works in a loop until a condition is met. For example in my space shooting game iteration is used many time especially when it came to the space rocket destroying the enemies ships.

PAGE 16

Page 18: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Iteration is used for the laser. If the enemy is not hit by the laser it will not be destroyed. If it has been hit by the laser it will be destroyed. If the loop has not proven to be false it will keep going on and on until it is true.

Selection is also very important in a computer game. Selection is where a question is asked and the depending on the answer given the code takes a course of action.. IF and else are selection methods and they have bee used in the game. An example of selection is when the question is posed, if enemy is destroyed remove it from the world or keep enemy in world if not destroyed. This is an example of selection.

Suggest improvements to a computer game following user feedbackI chose a few people to test my game and tell me what they thought about it. I asked 20 people and they gave me feedback on if they liked they game or not and where to improve on the game.

Did you like the game?

5 of the 20 people said the game was good but needed a few improvements.

12 of the 20 people said that the game was alright and could do with a lot more improving.

3 of the 20 people said that the game was boring and that there were so many things that needed to be added to the game to make it better.

What did you enjoy in the game?

You get to shoot rockets in space It very easy to play The enemies spawn from everywhere and makes everything different.

What do you not like about the game?

There are no challenges to achieve There is no point counter for how many enemies you destroy The game is way to simple and not very interesting Enemies should be different and shoot back The game should stop when rocket is destroyed There is no game over sign or page so not too interesting

PAGE 17

Page 19: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

What would you do to improve the game?

Add new challenges Add a score counter for how many enemies are destroyed Add a game over sign to show people that they have lost Make the game more complicated and fun Rocket should be destroyed if hit by enemy Enemies should be able to shoot lasers too

During this survey I have found out that they game needs a lot of improvements in the gameplay but also at the ending of the game. Another thing I that the simplicity of the game isn’t really appreciated by everyone and it seems that everyone wants to be challenged in the game, so that is something that I have to change.

Produce user documentation for a computer game and produce technical documentation for a computer game

This documentation will be for the computer game and will be easy to understand because the game is pretty simple in itself.

User Documentation

Specified game application

My shooter game is built in Greenfoot and can be accessed on any platform such a windows and Mac OS or anything that can run the application Greenfoot.

Purpose of game

The purpose of my game is to recreate the space game that is created for people to shoot other enemies.

Operation of the game

The game involves the user which is playing to use the mouse to control the rocket ship. The rocket will automatically shoot the lasers and destroys enemies if they are hit by the lasers.

Technical Documentation

Data Dictionary

PAGE 18

Page 20: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

A data dictionary allows you to store purposed field names and their types for the game that has been constructed. The data dictionary for my game is in the table that I have created.

Field Name Data Type PurposeMouse Info Private void This is to get information

on the mouse’s position SPEED Private integer Allows you to change

and control the speed of an object in the game

Move Private integer Move allows you to move the rocket ship in the game

setLocation Private integer Set location allows you to set the location of an object in the game.

Algorithm designs including control methods

A control methods are ways of controlling a program or wanting it to achieve something in particular. A control method is repetition which consists of looping for example. Looping is very important especially in the game that I have created because I have used looping when I comes to destroying enemies. Another control method is selection which is very important because if a question is asked an answer must be given and according to that answer something takes place. This is all about decision making which in my game I used many time. If enemy is not hit by laser remove laser and if the enemy is hit by the laser then remove the enemy. This is selection because the question is has the enemy been hit yes or no. According to the answer a looping will take place.

Selection

Selection is when a question is asked of the code and according to the answer a particular course of action is taken.

Iteration

Iteration is basically looping and until a condition is met the looping will go on for as long as needed to get to the wanted result.

User interface methods

User interface methods are very important because it is what the user sees. For example the opening screen to a game is part of the user interface.

Action Charts

PAGE 19

Page 21: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Action charts are important when giving instructions. Action charts are used to show what action will affect the game or program that is being used.

Action Tables

Action tables represent what actions will affect the game or program that is being used.

Class and instance diagrams

Class and instance diagrams shows how classes relate objects and how variables affect methods and classes.

Data Flow diagrams

Data flow diagrams show the flow of information in any process or system. A slow diagram can be found above for my task.

Explain how structure and design of a game can assist in maintenance and capacity for extension The structure and design of a game is very important especially when it comes to the maintenance of the game itself. In java’s programming language it is very important for you to have a structured piece of code or else it will be hard to find yourself round the code. In java you can also have bugs and errors in the code meaning that when you game is well structured it is easier to locate and fix the issue that is present. In my own game I have found it effective to have my code well structured because even when typing the code errors appeared.

Code Commenting

Code commenting is very important when it come to coding. I have found this useful in my code because the time delay of the lasers shot in the rocket had to be changed to suit the game. That would be hard if I didn’t comment the code but now that I have commented the code it is way easier to find what I want to do and how to modify it.

Code commenting has also been proved to help me to find my way around my code and how to help me maintain it. It may be that I had forgotten why I had written the code where it was but the code comments helped me to remember what they code was for.

PAGE 20

Page 22: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Variable Names and Naming Conventions

Variable names are very important in coding because it allows you to identify what the variable is. A variable name has to be unique to what it is representing and identifiable because that makes it easier to code with. A good variable name should describe the variable that it is representing not something else. Using a good variable name will also mean that making changes the game will be easier because you don’t need to worry about the variables and you know what the stand for.

PAGE 21

Page 23: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Indenting and Layout

Indenting and the layout of the code is very important. One, it helps you to organise you code and makes it easier to find yourself around the, it is easier to and also makes it possible to fix the code if there is an issue with it. Indenting makes the code look cleaner and more professional.

Modularisation

PAGE 22

Page 24: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

Modularity in a computer games code is very important because modularity is when you divide a program into smaller programs. When you combine all those small programs

together you can get a variety of functions. Modularity is good especially when you are trying to use the same code again because modularity actually enables you to do so. Modularity is also good because you can individually save all the small parts of the program and then recover them if they are lost or stolen.

Modularity also helps you to modify a program in greater detail. In conclusion modularity is very important in a program especially when a lot of detail is put in the game.

Syntax and Semantics

In java syntax is very important. Java is a language and the language so that it is understandable by the program must be correctly written. In java a semicolon is needed for a line of code to compile. If the syntax is not correct there will be a syntax error until

PAGE 23

Page 25: Produce a design for a computer game for a given ...€¦  · Web viewThe plan for the game called Shooter game which I have created to be like a shooting games where a rocket shoots

the issue is fixed. Syntax is also the only language that the programming system understands.

My own improvements

Based on the user feedback, I have realised that that there are many improvements that have to be made to the shooter game. The game needs to be more creative and have more levels to it. I feel that I can achieve this through more extensive coding. I will also create more enemies and give the enemies weapons to create more of a challenge in the game.

PAGE 24