Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Project Report
Prepared By:
1. Fahad Rasheed
2. Syed Ammar Hussain Kazmi
BC103016
BC103076
Supervise by:
Mr.Adnan Khalid
Abstract
The focus of our project is to design a game using unity 3d game engine. The player,
plays as a thief, who has to run and avoid the obstacles in the way, And from the
policeman who is chasing him. The game is designed for Android environment. In our
project, we have used multiple built-in functions that unity 3d game engine provides.
As a final product, we have developed a game that is fun and enjoyable.
Contents
CRAZY THEIF
1.
Introduction
1.1 Purpose
1.2 Scope
1.3 Objective
1.4 Tools & Techniques
1.4.1 Tools
1.4.2 Language
1.5 Time lines
2.
3.
System Design
3.1 System Sequence Diagram
3.1.1 Move Left
3.1.2 Move right
3.1.3 Slide down
3.1.4 Jump
3.1.5 Make sounds
3.1.6 Calculate score
3.1.7 Measures distance
3.1.8 Increase multiplier
3.2 System Architecture Diagram
Implementation
4.1 Tools and Technologies Used
4.1.2 Unity 3D
4.1.3 Maya
4.2 Software Description (coding)
4.2.1 How Game Starts
4.2.2 Replace the object
Deployment
5.2 Installation process description
5.2.1 How to install the Game
5.3 External dependencies
5.3.1 System Requirements
5.3.2 Android Devices
Conclusion
6.2 Evaluation of objective and aim
Appendix
CHAPTER 1
Introduction
1. Introduction
The application is a 3D-Android game Crazy Thief on his big Adventure. The thief
who is not only smart but also a clever runner who is being chased by the policeman
after he beats a lady. But beware! He faces different hurdles and obstacles along the
way. Explore fully interactive level less game and collect gold coins at every turn!
Gain as much money as you can. Everyone try to catch you but you are smart. This
game is pretty simple and casual, which takes you on the adventurous track, you will
never forget.
1.1
Purpose
The purpose of the project is to develop a game with a lighthearted feel and graphics.
This probably is going to make a sensation within the first minute.
1.1.1.List of deliverables
A Fully Functional Game at the end of the project.
1.2
Scope
The Scope of this project is to develop a game that will be challenging for the player.
The players will have to make quick decision to avoid the hurdles and obstacles as
the policeman try to catch him.
1.3
Objective
The main objectives which are implemented in this project are following.
To build an interesting game for user to play.
To build a game that improves the decision making power of a human as he/she has
to make a decision quickly.
1.5
Time lines
Deadlines
Artifacts
Final Project
CHAPTER 2
Software Requirement Analysis
2.1
Functional requirement documents the operations and activities that a system must be able
to perform
Ref.
No
Functional requirements
Priority
Nonfunctional
requirements
Category
R1
Must
System should be
available for 24/7.
Availability
R2
Must
System should be
available for 24/7.
Availability
R3
Must
System should be
available for 24/7.
Availability
R4
Must
System should be
available for 24/7.
Availability
R5
Must
System should be
available for 24/7.
Availability
R6
Must
System should be
available for 24/7.
Availability
R7
Must
System should be
available for 24/7.
Availability
R8
Must
System should be
available for 24/7.
Availability
Move left
Move
right
Swipe
down
Jump
System
Make
sounds
Player
Calculate
score
Measures
distance
Increase
multiplier
2.2
1
Move left
Author Name:
Fahad
Date Created:
Actors/Entity:
Player
Brief Description:
Preconditions:
Post conditions:
In order to move the thief left the player has to drag the screen from right
to left.
The player drags the screen from right to left.
The system should move the thief on left side on the track on which the
thief is running.
Normal Flow:
Actor Action
System Response
2
Move right
Author Name:
Fahad
Date Created:
Actors/Entity:
player
Brief Description:
Preconditions:
In order to move the thief right the player has to drag the screen from left
to right.
The player drags the screen from left to right.
10
Post conditions:
The system should move the thief on right side on the track on which the
thief is running.
Normal Flow:
Actor Action
System Response
3
Slide downwards
Author Name:
Fahad
Date Created:
Actors/Entity:
player
Brief Description:
Preconditions:
Post conditions:
Normal Flow:
In order to swipe the thief downwards the player has to drag the screen
from up to down.
The player drags the screen from up to down.
The system should swipe the thief downwards.
Actor Action
11
System Response
4
jump
Author Name:
Fahad
Date Created:
Actors/Entity:
player
Brief Description:
Preconditions:
Post conditions:
In order to swipe the thief upwards the player has to drag the screen
upwards.
The player drags the screen upwards.
The system should lift the thief up.
Normal Flow:
Actor Action
System Response
5
make sounds
Author Name:
Fahad
Date Created:
Actors/Entity:
player
Brief Description:
Preconditions:
Post conditions:
In order to make different sounds, the player has to move (left, right),
jump, and slide down the thief on the track.
The player drags the screen in any direction to move the thief.
The system should make sound in reaction of players action.
12
Normal Flow:
Actor Action
System Response
6
Calculate score
Author Name:
Fahad
Date Created:
Actors/Entity:
system
Brief Description:
Preconditions:
Post conditions:
In order to calculate the score systems should record the number of coins
collected by the player.
Game starts.
The systems calculate the score and display it.
Normal Flow:
Actor Action
1.Game starts
System Response
7
Measured distance
Author Name:
Fahad
Date Created:
Actors/Entity:
system
Brief Description:
Preconditions:
13
Post conditions:
Normal Flow:
Actor Action
1.Game starts
System Response
8
Increase multiplier
Author Name:
Fahad
Date Created:
Actors/Entity:
system
Brief Description:
Preconditions:
Post conditions:
Normal Flow:
In order to increase the multiplier of the player systems should check the
distance covered by the thief. More distance covered, increase multiplier.
Game starts.
The systems system check the distance covered by the thief. And
increase the multiplier over time.
Actor Action
1.Game starts
System Response
14
CHAPTER 3
System Design
3. System Design
System design is the process of defining the architecture, components and data for the
system to satisfy specified requirements.
15
Move Left
:
System
Us
er
Drags the screen right to left
Move the thief on left
Brief Description:
In order to move the thief left the player has to drag the screen from right to left.
3.1.2
Move right
:
System
Us
er
Drags the screen left to right
Moves the thief on right
Brief Description:
Drags
In order to move the thief left the
playerthe
hasscreen
to drag downwards
the screen from right left to right.
3.1.3
Slide down
16
:
System
Us
er
Brief Description:
In order to swipe the thief downwards the player has to drag the screen from up to down.
3.1.4
Jump
:
System
Us
er
Drags the screen upwards
Lift the thief up in the air
Brief Description:
In order to swipe the thief upwards the player has to drag the screen upwards.
3.1.5
Make sounds
Performs different actions
Makes sounds in response
17
:
System
.
Us
er
Brief Description:
In order to make different sounds, the player has to move (left, right), jump, and slide down
the thief on the track.
3.1.6
Calculate score
:
System
Us
er
Start playing the game
Brief Description:
In order to calculate the score systems follow the distance covered by the thief.
3.1.7
Measures distance
:
System
Brief Description:
In order to measure the distance systems should follow the thief.
3.1.8
Increase multiplier
:
System
Us
er
Brief Description:
In order to increase the multiplier of the player systems should check the distance covered
by the thief. More distance covered, increase multiplier.
19
Device
20
CHAPTER 4
Implementation
4 Implementation
Implementation is the carrying out, execution, or practice of a plan, a method, or any design
for doing something.
21
delivery to mobile devices, web browsers, desktops, and consoles. Supported platforms
include BlackBerry 10, Windows Phone 8, Windows, Android, iOS.
4.1.3 Maya
Maya 3D animation, modeling, simulation, rendering, and compositing software offers a
comprehensive creative feature set on a highly extensible production platform. Maya
provides high-end character and effects toolsets along with increased productivity for
modeling, texturing, and shade creation tasks.
}
4) We define three methods in the method Update():
Void Update ()
{
Update Player();
Update Coins();
Create New Cells If Needed (false) ;
}
Update Player()
22
Update the player, means when the user will give input to the system then according to given
input player perform its actions like jump, slide.
Update Coins()
Second method update the coins on each cells means on which position coins are to be
shown. Create coins () is define in update coin(). We write in update() because when game
starts on the first cell no coins were placed. Thats why we used update coin() in update ()
method.
Third method dynamically creates new cells and destroy previous cells when player visit the
cell once, then it destroy it and create a new one in different positions. We used only twelve
cells in the game. Our dynamically cells creation algorithm randomly select cell out of twelve
and place them at random position.
4.2.2 Replace the object
When player died and game ends, then the system call two functions:
Ragdoll ();
On GUI ();
First method will call when player died so what id does it replace the player with ragdoll.
Basically rag doll is a dead character we also use in our project.
If (player==null)
{
Game Object Rag Doll;
Player=Rag Doll;
}
4.2.3
Game Scripting
PLATFORM GENERATION SCRIPT
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class PLATFORMSCRIPTS : MonoBehaviour
{
23
}
}
// Update is called once per frame
void Update()
{
if (platforms[0].transform.position.z + DistanceToRecycle < runnerRef.transform.position.z)
{
GameObject g = platforms[0];
platforms.Remove(g);
//---------------------------------Vector3 tempScale = new Vector3(10, 13, 13);
g.transform.localScale = tempScale;
Vector3 tempPosition = new Vector3();
if (platforms.Count > 0)
{
tempPosition = platforms[platforms.Count - 1].transform.position;
tempPosition.z += platforms[platforms.Count - 1].transform.localScale.z * .5f;
}
24
g.transform.position = tempPosition;
g.transform.parent = gameObject.transform;
platforms.Add(g);
}
}
}
PLAYER GENERATION SCRIPT
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class character : MonoBehaviour
{
public GameObject gg;
void Start()
{
}
// Update is called once per frame
void Update()
{
float moveInputZ = Input.GetAxis("Horizontal") * Time.deltaTime * 2;
gg.transform.position += new Vector3(0, 0, Time.deltaTime * 2);
rigidbody.animation.Play("run");
}
//-------------------------------------------------}
25
plarer.animation.Play("punch");
plarer.animation.Play("punch");
}
// Update is called once per frame
void Update () {
count++;
plarer.animation.Play("run");
float moveInputZ = Input.GetAxis("Horizontal") * Time.deltaTime * 6;
// transform.position -= new Vector3(0, 0, moveInputZ);
transform.position += new Vector3(0, 0, Time.deltaTime * 8);
if (count == 120)
{
Application.LoadLevel("NEWONE");
}
}
}
count++;
float moveInputZ = Input.GetAxis("Horizontal") * Time.deltaTime * 6;
// transform.position -= new Vector3(0, 0, moveInputZ);
26
cc1=PlayerPrefs.GetInt("coin1");
if (cc1 == 1)
{
GameObject coin = (GameObject)Instantiate(m_GoldCoin, pos + laneOffset,
Quaternion.Euler(0, 360.0f / (k + 0.5f), 0));
cell.m_coins.Add(coin);
}
if (cc1 == 2)
{
GameObject coin = (GameObject)Instantiate(m_GoldCoin1, pos + laneOffset,
Quaternion.Euler(0, 360.0f / (k + 0.5f), 0));
cell.m_coins.Add(coin);
}
if (cc1 == 3)
{
GameObject coin = (GameObject)Instantiate(m_GoldCoin2, pos + laneOffset,
Quaternion.Euler(0, 360.0f / (k + 0.5f), 0));
cell.m_coins.Add(coin);
}
private void UpdateCoins()
{
27
if (m_player == null)
return;
28
CHAPTER 5
Deployment
5 Deployment
Deployment is all of the activities that make software available for use.
29
Step 1:
Go to the Google Play Store and search for Crazy Thief on your Android tablet or
Smartphone.
Step 2:
Press the download button.
Step 3:
Install the game and start playing.
OS 2.3.1 or later
ARMv7 (Cortex) CPU or Atom CPU
OpenGL ES 2.0 or later.
Samsung galaxy S3
Samsung galaxy S3(Neo)
Qmobile Noir A10
Sony Xperia
Prestigio Multipad 7.0
30
CHAPTER 6
Conclusion
6 Conclusion
6.2 Evaluation of objective and aim
The main objectives which are implemented in this project are following.
To build an interesting game for user to play.
31
To build a game that improves the decision making power of a user as he/she has to make a
decision quickly.
32
Appendix
Figure 3.2.1(Splash)
33
Figure 3.2.2(Menu)
34
Figure 3.2.3(Play)
35
36
37
Figure 3.2.6(Score)
38
Figure 3.2.7(Help)
39
40