0% found this document useful (0 votes)
514 views

Final Gaming Report1

This project report summarizes the development of a game called Fruit King. It was developed by a group of students at Lovely Professional University to fulfill their degree requirements. The report includes an introduction to the game, objectives, system analysis including feasibility study, data flow diagrams, software and hardware requirements, system design, screenshots and coding details, and validation checks. The game was developed using the Unity game engine and targets multiple platforms including Windows, Mac, iOS and Android.

Uploaded by

Manideep Kittu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
514 views

Final Gaming Report1

This project report summarizes the development of a game called Fruit King. It was developed by a group of students at Lovely Professional University to fulfill their degree requirements. The report includes an introduction to the game, objectives, system analysis including feasibility study, data flow diagrams, software and hardware requirements, system design, screenshots and coding details, and validation checks. The game was developed using the Unity game engine and targets multiple platforms including Windows, Mac, iOS and Android.

Uploaded by

Manideep Kittu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Project Report

on

FRUITKING

Submitted to

LOVELY PROFESSIONAL UNIVERSITY

in partial fulfilment of the requirements for the award of degree of

Bachelor of Computer Science and Engineering

Submitted by Supervised by

K. Manideep 11504768 Ms. Pooja Dhiman

Lanka Naga Sai deep 11502458 Assistant professor

Shashidhar 11502672 School of Computer Applications

Jyotishman Rout 11504534

LOVELY FACULTY OF TECHNOLOGY & SCIENCES

LOVELY PROFESSIONAL UNIVERSITY

PUNJAB
[Dec, 2018]
TOPIC APPROVAL PERFORMA

School of Computer Application (SCA)

Program:P132::B.Tech. (Computer Science & Engineering)

COURSE CODE : CAP821 REGULAR/BACKLOG : Regular GROUP NUMBER : CARGC0088

Supervisor Name : Pooja Dhiman UID : 23673 Designation : Assistant Professor

Qualification : ________________________ Research Experience : ________________________

SR.NO. NAME OF STUDENT REGISTRATION NO BATCH SECTION CONTACT NUMBER

1 Koppunoori Manideep 11504768 2015 K1515 9915737273


2 M C Jyotishman Rout 11504534 2015 K1507 7032839380
3 Gopavaram Shashidhar Reddy 11502672 2015 K1514 9618659088
4 Lanka Naga Sai Deep 11502458 2015 K1503 7396848044
5 Bali Sai Kiran 11502358 2015 K1514 9041174022

SPECIALIZATION AREA : Systems and Architecture Supervisor Signature: ___________________

PROPOSED TOPIC : Fruit King Game

Qualitative Assessment of Proposed Topic by PAC

Sr.No. Parameter Rating (out of 10)

1 Project Novelty: Potential of the project to create new knowledge 6.00

2 Project Feasibility: Project can be timely carried out in-house with low-cost and available resources in 6.67
the University by the students.
3 Project Academic Inputs: Project topic is relevant and makes extensive use of academic inputs in UG 5.33
program and serves as a culminating effort for core study area of the degree program.
4 Project Supervision: Project supervisor’s is technically competent to guide students, resolve any issues, 6.67
and impart necessary skills.
5 Social Applicability: Project work intends to solve a practical problem. 6.00

6 Future Scope: Project has potential to become basis of future research work, publication or patent. 6.33

PAC Committee Members

PAC Member 1 Name: Balraj Kumar UID: 11004 Recommended (Y/N): Yes

PAC Member 2 Name: Rishi Chopra UID: 11111 Recommended (Y/N): NA

PAC Member 3 Name: Dr. Amandeep UID: 11202 Recommended (Y/N): NA

PAC Member 4 Name: Sartaj Singh UID: 11303 Recommended (Y/N): NA

PAC Member 5 Name: Pawan Kumar UID: 11522 Recommended (Y/N): Yes

DAA Nominee Name: Anuj Sharma UID: 20592 Recommended (Y/N): Yes

Final Topic Approved by PAC: Fruit King Game: should be more creative and complexity

Overall Remarks: Approved (with minor changes)

11/15/2018 12:22:03 PM
CERTIFICATE

This is to certify that K. Manideep, G. Shashidhar Reddy, Lanka Naga Sai deep, Jyotishman
Rout has completed their project titled Fruit king under my guidance and supervision. To the
best of my knowledge, the present work is the result of his original study. No part of the report
has ever been submitted for any other degree or diploma. The report is fit for the submission and
the partial fulfilment of the conditions for the award of B.Tech.

15-11-2018 Ms. Pooja Dhiman


ACKNOWLEDGEMENT

It is a pleasure to find myself penning down these lines to express my sincere thanks to all my
teammates to give me this opportunity of preparing this project. This project required hard work
that I tried my best to put in this project and in turn gained a lot of knowledge and confidence
from this project. We are grateful to our Project Guide Ms. Pooja Dhiman for the inspiration
and the constructive suggestions that helped me in preparation of the project Survival of the
fastest.
Table of Contents
CHAPTER 1. INTRODUCTION AND OBJECTIVE .............................................................. 1
Abstract ...................................................................................................................................... 1
Introduction to Unity3D ............................................................................................................ 1
Overview ..................................................................................................................................... 1
Objective ..................................................................................................................................... 2
CHAPTER 2. SYSTEM ANALYSIS .......................................................................................... 2
Selecting Features from Existing System ................................................................................ 2
Feasibility Study ........................................................................................................................ 3
Technical feasibility ................................................................................................................... 3
Economic feasibility ................................................................................................................... 4
Operational Feasibility .............................................................................................................. 4
Behavioural Feasibility.............................................................................................................. 5
CHAPTER 3. DFD ........................................................................................................................ 6
Level 0:........................................................................................................................................ 6
Level 1:........................................................................................................................................ 6
Level 2:........................................................................................................................................ 6
CHAPTER 4. S/W & H/W REQUIREMENT SPECIFICATION .......................................... 7
Unity (engine) ............................................................................................................................. 7
Windows-Based Requirements ................................................................................................. 7
Mac-Based Requirements ......................................................................................................... 8
IOS .............................................................................................................................................. 8
The Android SDK ...................................................................................................................... 8
For Windows 8.1 Mobile Devices ............................................................................................. 8
CHAPTER 5. SYSTEM DESIGN ............................................................................................... 9
CHAPTER 6. SCREEN SHOTS WITH CODING.................................................................. 11
Screenshots ............................................................................................................................... 11
Coding ....................................................................................................................................... 17
CHAPTER 7. VALIDATION CHECKS .................................................................................. 42
Score Validation ....................................................................................................................... 42
Restart Validation.................................................................................................................... 42
User Validation ........................................................................................................................ 42
On click Validation .................................................................................................................. 42
Game files Validation .............................................................................................................. 42
CHAPTER 8. IMPLEMENTATION AND MAINTENANCE .............................................. 43
Coding ....................................................................................................................................... 43
Testing....................................................................................................................................... 43
Installation................................................................................................................................ 43
Managing Programming ......................................................................................................... 43
Coordinating Activities ........................................................................................................... 43
Managing the Schedule ........................................................................................................... 44
DESIGNING TESTS ............................................................................................................... 44
Developing Documentation ..................................................................................................... 44
Maintaining information systems........................................................................................... 45
Platform Maintenance ............................................................................................................. 45
CHAPTER 9. TESTING (TESTING TECHNIQUES AND TESTING STRATEGIES) .... 46
Functional Testing ................................................................................................................... 46
Structural Testing .................................................................................................................... 46
Levels of Testing ...................................................................................................................... 46
Functional Testing ................................................................................................................ 47
Non-Functional Testing ....................................................................................................... 48
CHAPTER 10. SYSTEM SECURITY AND MEASURES ..................................................... 50
Theory and Method of Exploitation....................................................................................... 50
Practice and Methodology Step-By-Step ............................................................................... 50
CHAPTER 11. VARIOUS TYPES OF MODULES ................................................................ 51
CHAPTER 12. FUTURE SCOPE OF THE PROJECT.......................................................... 52
CHAPTER 1. INTRODUCTION AND OBJECTIVE

Abstract
Today, the computer games industry is one of the most profitable industries in the world. Games
are something which everyone loves to play on their computer. In fact, it is one of the most used
applications in a computer. Games help you relax, and they are a perfect way of killing time
when you are feeling bored. These factors have inspired us to make a project which aims at
creating games. Our project aims at using c# language to make games. Our project is titled
Game. In our project we will use graphics supported by C# to make the games. Through the use
of these graphics we will try to make the games interesting graphically. The games module
which we have included in our project are: -
1) Super Mario
2) Temple Run
3) Subway surfers
4) Pokémon
5) Super Sonic

Introduction to Unity3D
Unity is a cross-platform game engine developed by Unity Technologies, first announced and
released in June 2005 at Apple Inc.'s Worldwide Developers Conference as an OS X-exclusive
game engine. As of 2018, the engine has been extended to support 27 platforms. The engine can
be used to create both three-dimensional and two-dimensional games as well as simulations for
its many platforms. Several major versions of Unity have been released since its launch, with the
latest stable version being Unity 2018.2.13.

Overview
Unity gives users the ability to create games in both 2D and 3D, and the engine offers a primary
scripting API in C#, for both the Unity editor in the form of plugins, and games themselves, as
well as drag and drop functionality. Prior to C# being the primary programming language used
for the engine, it previously supported Boo, which was removed in the Unity 5 release, and a
version of JavaScript called Unity Script, which was deprecated in August 2017 after the release
of Unity 2017.1 in favor of C#.

1
Objective
The objective of this project was the creation of an easy to use, pick up and play game that could
be played by all ages as long as they have an android phone and a touch screen. The reason was
as stated above there are more casual gamers than traditional gamers meaning a larger potential
market. Developing on the Android platform will mean we have to program in JAVA or C# and
get to grips with the Android SDK. I should also learn the fundamentals of game programming
and stick to the lifecycle associated with developing games. The Android SDK does not provide
a comprehensive set of tools to create a game straight away. It does require a lot of extra work. I
could potentially create my own framework or perhaps use an existing one, to ease the process
and produce software that is appealing and efficient
The purpose of this document is to set up the requirements for the development of Android 2D
car racing game. The intended customer is really anyone with an android device. A car game is
simple and fun to play making it available to anyone.

CHAPTER 2. SYSTEM ANALYSIS

Selecting Features from Existing System


After reviewing the games, we now must identify all the features that we would implement. we have
gained a lot of knowledge from our research; despite being an enthusiastic racing gamer, we still
managed to find games that we had not previously heard of such as adventure game. All the games
we tested were final products and due to the timescale, we will not be able to achieve a project
that is finished and can be put out to the general public to play without any hiccups. From all the
applications we tested, we identified the following core functions which we will implement:

• Physics - The character will have to be able to move using the front two feet for
control and depending on the drive of the system, whether power is applied to all feet.
This physics only needs to be simulated in 2D in a top down perspective. When a
character hits an obstacle, then the relevant actions should be applied to the character and
it should die. Appropriate collision detection also needs to be used to identify these
crashes.

2
• Attractive user interface - The interfaces of the games tested are very appealing;
each one also has a heads-up display showing various in-game parameters.

• Graphics - This is very important to make the game more appealing;

• Camera - All top down games have the same camera, the player in the centre and a
view of the world around it.

Feasibility Study
A Feasibility study is undertaken to determine the possibility or portability of either improving
the existing system or developing a completely new system. Feasibility is the measure of how
beneficial or practical the development of information system will be to an organization. The
feasibility study involves following criteria.
• Whether the identified user needs may be satisfied using current software and
hardware
• technologies.
• The study will decide if the proposed system will be cost-effective and if it can be
developed given existing budgetary constraints.
• The result should inform the decision of whether to go ahead with a more detailed
analysis.

There are three methods of feasibility study.


1. Technical feasibility

2. Economic feasibility

3. Behaviour feasibility

Technical feasibility

It is measure of the practicality of specific technical solution and the availability of technical
resources and expertise. Technical feasibility is computer oriented. The “Profile Manager”,
“Flappy Bird” and “Nightmare” and is technical feasible because of the following reasons

In Game hardware and software requirement are easily available.

The games have a good GUI interface.

The games will have user friendly form and screen.

3
To check whether the module technically feasible or not we have to give the following
two question answer.

Q-1 Is the proposed system practical?


Ans. The proposed system is practical as we have all the resources available. Also building up
this module requires the minimum amount of hardware & software is easily available. So, the
proposed system is extremely efficient and practical.
Q-2 Do we currently possess the necessary technology?
Ans. Looking into the system requirement, we can see that we possess all the hardware and
software requirements. Also, the technology used is easily available and deployed all around
the world.

Economic feasibility
It is a measure of the cost-effectiveness of a project or solution. This is often called a cost-benefit
analysis. Economic feasibility deals with the cost and benefits of the information system.

In the economic feasibility, the development cost of the system is evaluated weighing it
against the ultimate benefit derived from the new system. It is found that the benefit from the
new system would be more than the cost and time involved in its development.

The Game is Economical feasible because of the following reasons.


Game requires less time to react for the user. The cost of the hardware and software are normal.
The system provides the services for the decision making. As this not begins a conversion of the
present module into and rather begins creating a new module from scratch, the cost of the
module includes cost of the module development; implementation and it not include the
maintenance.

Operational Feasibility
Operational feasibility covers two aspects. One is the technical performance aspect and other
is the acceptance. Operational feasibility determines how the proposed system will fit in the
current operations and what, if any job restructuring and retraining may be needed to
implement the system.

In the system operational feasibility checks, whether the user who is going to use the system is
able to work with the software’s with which the system is coded and also the mind of the user

4
going to use the system. If the user does not understand or is able to work on the system further
development is of waste

Behavioural Feasibility

Behaviour feasibility determines how much effort will go in the proposed information
system and in education and training efficiency on the new system.

It is a measure of how well the solution will work in the organization. It is also a measure of
how people feel about the application. Behaviour feasibility is people oriented. Some question
arises in the behaviour feasibility, we discuss on this question.

Q-1 Is the problem worth solving or will the solution to the problem work?
Ans. Yes, the problem is off course worth solving because the system existing today is more
time consuming and full of extra content like advertisement, other application link etc. so, the
problem is worth solving.

Q-2 How the end-user feels about the problem?


Ans. This Game provides a best operator specification through its user friendliness. That is
any kind of training is not required to play the game. So, the non-technical person can use it.

5
CHAPTER 3. DFD
Level 0:

Level 1:

Level 2:

6
CHAPTER 4. S/W & H/W REQUIREMENT SPECIFICATION

The project is being developed in Unity engine. Unity engine is used as front end. And for back
end C# is used. We use Android SDK to switch the platform to Android in Unity. C# is used for
event Handling.

Unity (engine)
A 3D engine of course, is a physics engine that handles the laws and behaviors of various game
objects.
C#

It also handles the rendering of graphics, lighting and physics like gravity and momentum and
may even have some gameplay elements included.
If you want to create a 3D engine from scratch, you’ll need to code everything from the way a
glass falls off a table down to the way it bounces and refracts light on the way down.
Unity3D is one of the simplest and has an interface that makes it almost ‘game maker’ like. It
also has the advantage of being truly cross platform.
The hardware and software requirements for building apps in Unity3D vary depending on your
operating system and the digital platforms for which you are developing. Click from the
following list to find out more.
• Windows-based requirements
• Mac-based requirements
• Additional requirements by platform
• iOS
• Android
• Windows Mobile

Windows-Based Requirements
Computers running Microsoft Windows must meet the following minimum hardware and
software requirements.
Dual-core 64-bit processor
8 GB of memory
Up to 24 GB of internal storage (Unity3D: 4GB, Android SDK: 2GB, Windows SDK: 4GB, plus
ample space for multiple complex projects) Network interface card Windows 10, Windows 8.1
Update, Windows 8, and Windows 7

7
Mac-Based Requirements
Apple computers must meet the following minimum hardware and software requirements.x86-64
processor (64-bit Mac with an Intel Core 2 Duo, Intel Core i3, Intel Core i5, Intel Core i7, or
Xeon processor)
8 GB of memory
150 GB of internal storage (Unity3D: 4GB, Storage for multiple, complex projects: 10GB, Apple
XCode: varies, depending on the features and simulators you install, and the number of earlier
versions of iOS your app needs to support) Network interface card Mac OS X version 10.7 and
above Java SE 7 runtime (Required by Eclipse. You are prompted to install Java SE 7 runtime
the first time you launch Konya Visualizer.) Additional Requirements by Platform Along with
those previously listed, each development platform has additional requirements. Detailed
information on how to meet these requirements is provided in the procedures for installing each
platform's respective software development kit (SDK) and emulator.

IOS
Developing apps for iOS includes the following requirements. IOS-related code and applications
can only be developed on a Mac OS computer the latest version of XCode, the Apple SDK for
creating iOS apps Android Developing apps for Android includes the following requirements.

The Android SDK


• Apache Ant (Another Neat Tool), an open-source tool that automates aspects of the
Android build process.
• Gradle (An advanced build toolkit that manages dependencies and allows to define
custom build logic.)
• Windows Mobile
• Developing apps for Windows Mobile includes the following requirements.

For Windows 8.1 Mobile Devices


• A processor that supports Second Level Address Translation (SLAT)
• Windows 8 Pro edition with the 8.1 update
• 6.5 GB of internal storage
• 8 GB memory
• Windows Phone SDK 8.0
• Visual Studio Express 2013 for Windows

8
• Windows Phone 8.1 Update 1 Emulators
• For Windows 8.0 Mobile Devices
• A processor that supports Second Level Address Translation (SLAT)
• Windows 8 Pro edition or greater
• 8 GB of internal storage
• 4 GB memory
• Windows Phone SDK 8.0
• Visual Studio Express 2013 for Windows

CHAPTER 5. SYSTEM DESIGN

Systems design is simply the design of systems. It implies a systematic and rigorous approach to
design—an approach demanded by the scale and complexity of many systems problems. The
purpose of System Design is to create a technical solution that satisfies the functional
requirements for the system. At this point in the project lifecycle there should be a Functional
Specification, containing a complete description of the operational needs of the various
organizational entities that will use the new system. The challenge is to translate all of this
information into Technical Specifications that accurately describe the design of the system, and
that can be used as input to System Construction.

The Functional Specification produced during System Requirements Analysis is transformed


into a physical architecture. System components are distributed across the physical architecture,
usable interfaces are designed and prototyped, and Technical Specifications are created for the
Application Developers, enabling them to build and test the system.

9
The following diagram shows the system design of our project

Game Activity

GameView

Game
Command
Tile Map

Sprite
Input Objects
Control

10
CHAPTER 6. SCREEN SHOTS WITH CODING
Screenshots

11
12
13
14
15
16
Coding

Chest.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RedRunner.Characters;

namespace RedRunner.Collectables
{

public class Chest : Collectable


{

[SerializeField]
protected Animator m_Animator;
[SerializeField]
protected Collider2D m_Collider2D;
[SerializeField]
protected SpriteRenderer m_SpriteRenderer;
[SerializeField]
protected bool m_UseOnTriggerEnter2D = true;
[SerializeField]
protected int m_MinimumCoins = 5;
[SerializeField]
protected int m_MaximumCoins = 10;
[SerializeField]
protected CoinRigidbody2D m_CoinRigidbody2D;
[SerializeField]
protected Transform m_SpawnPoint;
[SerializeField]
protected ParticleSystem m_ParticleSystem;
[SerializeField]
[Range (-100f, 100f)]
protected float m_RandomForceYMinimum = -10f;
[SerializeField]
[Range (-100f, 100f)]
protected float m_RandomForceYMaximum = 10f;
[SerializeField]
[Range (-100f, 100f)]
protected float m_RandomForceXMinimum = -10f;
[SerializeField]
[Range (-100f, 100f)]
protected float m_RandomForceXMaximum = 10f;

protected Character m_CurrentCharacter;

public override Animator Animator {


get {
return m_Animator;

17
}
}

public override Collider2D Collider2D {


get {
return m_Collider2D;
}
}

public override SpriteRenderer SpriteRenderer {


get {
return m_SpriteRenderer;
}
}

public override bool UseOnTriggerEnter2D {


get {
return m_UseOnTriggerEnter2D;
}
set {
m_UseOnTriggerEnter2D = value;
}
}

public virtual int MinimumCoins {


get {
return m_MinimumCoins;
}
}

public virtual int MaximumCoins {


get {
return m_MaximumCoins;
}
}

public virtual CoinRigidbody2D CoinRigidbody2D {


get {
return m_CoinRigidbody2D;
}
}

public virtual Transform SpawnPoint {


get {
return m_SpawnPoint;
}
}

public virtual ParticleSystem ParticleSystem {


get {
return m_ParticleSystem;
}
}

18
public virtual float RandomForceYMinimum {
get {
return m_RandomForceYMinimum;
}
set {
m_RandomForceYMinimum = value;
}
}

public virtual float RandomForceYMaximum {


get {
return m_RandomForceYMaximum;
}
set {
m_RandomForceYMaximum = value;
}
}

public virtual float RandomForceXMinimum {


get {
return m_RandomForceXMinimum;
}
set {
m_RandomForceXMinimum = value;
}
}

public virtual float RandomForceXMaximum {


get {
return m_RandomForceXMaximum;
}
set {
m_RandomForceXMaximum = value;
}
}

public override void OnCollisionEnter2D (Collision2D collision2D)


{
Character character = collision2D.collider.GetComponent<Character> ();
if (!m_UseOnTriggerEnter2D && character != null) {
m_CurrentCharacter = character;
Collect ();
}
}

public override void OnTriggerEnter2D (Collider2D other)


{
Character character = other.GetComponent<Character> ();
if (m_UseOnTriggerEnter2D && character != null) {
m_CurrentCharacter = character;
Collect ();
}

19
}

public override void Collect ()


{
m_Animator.SetBool ("Open", true);
}

public virtual void OnChestOpened ()


{
AudioManager.Singleton.PlayChestSound (transform.position);
m_ParticleSystem.Play ();
int coinsCount = Random.Range (m_MinimumCoins, m_MaximumCoins);
for (int i = 0; i < coinsCount; i++) {
CoinRigidbody2D coin = Instantiate<CoinRigidbody2D> (m_CoinRigidbody2D,
m_SpawnPoint.position, Quaternion.identity, transform);
float x = Random.Range (m_RandomForceXMinimum, m_RandomForceXMaximum);
float y = Random.Range (m_RandomForceYMinimum, m_RandomForceYMaximum);
Vector2 force = new Vector2 (x, y);
coin.Rigidbody2D.AddForce (force, ForceMode2D.Impulse);
StartCoroutine (IgnoreAndEnableCollision (m_CurrentCharacter.Collider2D, coin.Collider2D));
}
}

protected virtual IEnumerator IgnoreAndEnableCollision (Collider2D collider2D1, Collider2D


collider2D2)
{
Physics2D.IgnoreCollision (collider2D1, collider2D2, true);
yield return new WaitForSeconds (0.3f);
Physics2D.IgnoreCollision (collider2D1, collider2D2, false);
}

Coin.cs

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Characters;

namespace RedRunner.Collectables
{
public class Coin : Collectable
{
[SerializeField]
protected ParticleSystem m_ParticleSystem;
[SerializeField]
protected SpriteRenderer m_SpriteRenderer;
[SerializeField]

20
protected Collider2D m_Collider2D;
[SerializeField]
protected Animator m_Animator;
[SerializeField]
protected bool m_UseOnTriggerEnter2D = true;

public override SpriteRenderer SpriteRenderer {


get {
return m_SpriteRenderer;
}
}

public override Animator Animator {


get {
return m_Animator;
}
}

public override Collider2D Collider2D {


get {
return m_Collider2D;
}
}

public override bool UseOnTriggerEnter2D {


get {
return m_UseOnTriggerEnter2D;
}
set {
m_UseOnTriggerEnter2D = value;
}
}

public override void OnTriggerEnter2D (Collider2D other)


{
Character character = other.GetComponent<Character> ();
if (m_UseOnTriggerEnter2D && character != null) {
Collect ();
}
}

public override void OnCollisionEnter2D (Collision2D collision2D)


{
Character character = collision2D.collider.GetComponent<Character> ();
if (!m_UseOnTriggerEnter2D && character != null) {
Collect ();
}
}

public override void Collect ()


{
GameManager.Singleton.m_Coin.Value++;
m_Animator.SetTrigger (COLLECT_TRIGGER);

21
m_ParticleSystem.Play ();
m_SpriteRenderer.enabled = false;
m_Collider2D.enabled = false;
Destroy (gameObject, m_ParticleSystem.main.duration);
AudioManager.Singleton.PlayCoinSound (transform.position);
}
}
}

Eye.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Characters;

namespace RedRunner.Enemies
{

public class Eye : MonoBehaviour


{

[SerializeField]
protected float m_Radius = 1f;
[SerializeField]
protected Transform m_Pupil;
[SerializeField]
protected Transform m_Eyelid;
[SerializeField]
protected float m_MaximumDistance = 5f;
[SerializeField]
protected Character m_LatestCharacter;
[SerializeField]
protected Vector3 m_InitialPosition;
[SerializeField]
protected float m_Speed = 0.01f;
[SerializeField]
protected float m_DeadSpeed = 0.005f;
[SerializeField]
protected Vector3 m_DeadPosition;
protected Vector3 m_PupilDestination;

public virtual float Radius {


get {
return m_Radius;
}
set {
m_Radius = value;
}
}

public virtual Transform Pupil {

22
get {
return m_Pupil;
}
}

public virtual Vector3 InitialPosition {


get {
return m_InitialPosition;
}
}

public virtual Vector3 PupilDestination {


get {
return m_PupilDestination;
}
}

public virtual float Speed {


get {
return m_Speed;
}
}

protected virtual void Awake ()


{
// m_InitialPosition = m_Pupil.transform.position;
}

protected virtual void Update ()


{
Collider2D [] colliders = Physics2D.OverlapCircleAll ( transform.parent.position, m_MaximumDistance,
LayerMask.GetMask ( "Characters" ) );
for ( int i = 0; i < colliders.Length; i++ )
{
Character character = colliders [ i ].GetComponent<Character> ();
if ( character != null )
{
m_LatestCharacter = character;
}
}
SetupPupil ();
}

protected virtual void OnDrawGizmos ()


{
Gizmos.DrawWireSphere ( transform.position, m_Radius );
Gizmos.DrawWireSphere ( transform.parent.position, m_MaximumDistance );
}

protected virtual void SetupPupil ()


{
if ( m_LatestCharacter != null )
{

23
float speed = m_Speed;
Vector3 distanceToTarget = m_LatestCharacter.transform.position - m_Pupil.position;
if ( m_LatestCharacter.IsDead.Value )
{
speed = m_DeadSpeed;
distanceToTarget = Vector3.ClampMagnitude ( m_DeadPosition, m_Radius );
Vector3 finalPupilPosition = transform.position + distanceToTarget;
m_PupilDestination = finalPupilPosition;
}
else
{
float distance = Vector3.Distance ( m_LatestCharacter.transform.position, transform.parent.position );
if ( distance <= m_MaximumDistance )
{
distanceToTarget = Vector3.ClampMagnitude ( distanceToTarget, m_Radius );
}
else
{
distanceToTarget = Vector3.ClampMagnitude ( m_InitialPosition, m_Radius );
}
Vector3 finalPupilPosition = transform.position + distanceToTarget;
m_PupilDestination = finalPupilPosition;
}
m_Pupil.position = Vector3.MoveTowards ( m_Pupil.position, m_PupilDestination, speed );
}
}

Mace.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Characters;
using RedRunner.Utilities;

namespace RedRunner.Enemies
{

public class Mace : Enemy


{

[SerializeField]
protected Collider2D m_Collider2D;
[SerializeField]
protected Animator m_Animator;
[SerializeField]
protected PathFollower m_PathFollower;
[SerializeField]

24
protected float m_MaulSpeed = 0.5f;
[SerializeField]
protected float m_MaulScale = 0.8f;
[SerializeField]
protected ParticleSystem m_ParticleSystem;

public override Collider2D Collider2D {


get {
return m_Collider2D;
}
}

protected virtual void Awake ()


{
GameManager.OnReset += Reset;
}

protected virtual void OnDestroy ()


{
GameManager.OnReset -= Reset;
}

void Reset ()
{
m_Animator.SetTrigger ("Reset");
m_PathFollower.Stopped = false;
}

void OnCollisionEnter2D (Collision2D collision2D)


{
Vector2 position = collision2D.contacts [0].point;
Character character = collision2D.collider.GetComponent<Character> ();
bool pressable = false;
for (int i = 0; i < collision2D.contacts.Length; i++) {
if (!pressable) {
pressable = (collision2D.contacts [i].normal.y >= 0.8f && collision2D.contacts [i].normal.y <= 1f &&
m_PathFollower.Velocity.y > m_MaulSpeed) ||
(collision2D.contacts [i].normal.y <= -0.8f && collision2D.contacts [i].normal.y >= -1f &&
m_PathFollower.Velocity.y < m_MaulSpeed) ||
(collision2D.contacts [i].normal.x >= 0.8f && collision2D.contacts [i].normal.x <= 1f &&
m_PathFollower.Velocity.x < m_MaulSpeed) ||
(collision2D.contacts [i].normal.x <= -0.8f && collision2D.contacts [i].normal.x >= -1f &&
m_PathFollower.Velocity.x > m_MaulSpeed);
} else {
break;
}
}
if (pressable && character == null && !collision2D.collider.CompareTag ("Player")) {
Slam (position);
}
if (character != null && !character.IsDead.Value) {
if (pressable) {
Slam (position);

25
Vector3 scale = character.transform.localScale;
scale.y = m_MaulScale;
character.transform.localScale = scale;
}
Kill (character);
}
// Camera.main.GetComponent<CameraControl> ().Shake (3f, 30, 300f);
}

public virtual void Slam (Vector3 position)


{
AudioManager.Singleton.PlayMaceSlamSound (transform.position);
ParticleSystem particle = Instantiate<ParticleSystem> (m_ParticleSystem, position,
m_ParticleSystem.transform.rotation);
Destroy (particle.gameObject, particle.main.duration);
}

public override void Kill (Character target)


{
m_PathFollower.Stopped = true;
target.Die (true);
m_Animator.SetTrigger ("Smile");
AudioManager.Singleton.PlaySpikeSound (transform.position);
}

Saw.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Characters;

namespace RedRunner.Enemies
{

public class Saw : Enemy


{

[SerializeField]
private Collider2D m_Collider2D;
[SerializeField]
private Transform targetRotation;
[SerializeField]
private float m_Speed = 1f;
[SerializeField]
private bool m_RotateClockwise = false;
[SerializeField]
private AudioClip m_DefaultSound;

26
[SerializeField]
private AudioClip m_SawingSound;
[SerializeField]
private AudioSource m_AudioSource;

public override Collider2D Collider2D {


get {
return m_Collider2D;
}
}

void Start ()
{
if (targetRotation == null) {
targetRotation = transform;
}
}

void Update ()
{
Vector3 rotation = targetRotation.rotation.eulerAngles;
if (!m_RotateClockwise) {
rotation.z += m_Speed;
} else {
rotation.z -= m_Speed;
}
targetRotation.rotation = Quaternion.Euler (rotation);
}

void OnCollisionEnter2D (Collision2D collision2D)


{
Character character = collision2D.collider.GetComponent<Character> ();
if (character != null) {
Kill (character);
}
}

void OnCollisionStay2D (Collision2D collision2D)


{
if (collision2D.collider.CompareTag ("Player")) {
if (m_AudioSource.clip != m_SawingSound) {
m_AudioSource.clip = m_SawingSound;
} else if (!m_AudioSource.isPlaying) {
m_AudioSource.Play ();
}
}
}

void OnCollisionExit2D (Collision2D collision2D)


{
if (collision2D.collider.CompareTag ("Player")) {
if (m_AudioSource.clip != m_DefaultSound) {
m_AudioSource.clip = m_DefaultSound;

27
}
m_AudioSource.Play ();
}
}

public override void Kill (Character target)


{
target.Die (true);
}

Spike.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Characters;

namespace RedRunner.Enemies
{

public class Spike : Enemy


{

[SerializeField]
private Collider2D m_Collider2D;
[SerializeField]
private FixedJoint2D m_FixedJoint2D;

public override Collider2D Collider2D {


get {
return m_Collider2D;
}
}

void OnCollisionStay2D (Collision2D collision2D)


{
Character character = collision2D.collider.GetComponent<Character> ();
if (character && !character.IsDead.Value) {
bool isTop = false;
ContactPoint2D mainPoint;
for (int i = 0; i < collision2D.contacts.Length; i++) {
if (!isTop) {
isTop = collision2D.contacts [i].normal.y < -0.7f && collision2D.contacts [i].normal.y >= -1f;
} else {
break;
}
}
if (isTop) {

28
Kill (character);
}
}
}

public override void Kill (Character target)


{
target.Die (true);
m_FixedJoint2D.connectedBody = target.GetComponent<Skeleton> ().Body;
AudioManager.Singleton.PlaySpikeSound (transform.position);
}

Water.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Characters;

namespace RedRunner.Enemies
{

public class Water : Enemy


{

[SerializeField]
private Collider2D m_Collider2D;

public override Collider2D Collider2D {


get {
return m_Collider2D;
}
}

void OnTriggerEnter2D (Collider2D other)


{
Character character = other.GetComponent<Character> ();
if (character != null) {
Kill (character);
}
}

public override void Kill (Character target)


{
target.Die ();
Vector3 spawnPosition = target.transform.position;
spawnPosition.y += -1f;

29
ParticleSystem particle = Instantiate<ParticleSystem> (target.WaterParticleSystem, spawnPosition,
Quaternion.identity);
Destroy (particle.gameObject, particle.main.duration);
AudioManager.Singleton.PlayWaterSplashSound (transform.position);
}

Collectible.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RedRunner.Collectables
{

[RequireComponent (typeof(SpriteRenderer))]
[RequireComponent (typeof(Collider2D))]
[RequireComponent (typeof(Animator))]
public abstract class Collectable : MonoBehaviour
{

public const string COLLECT_TRIGGER = "Collect";

public abstract SpriteRenderer SpriteRenderer { get; }

public abstract Collider2D Collider2D { get; }

public abstract Animator Animator { get; }

public abstract bool UseOnTriggerEnter2D { get; set; }

public abstract void OnTriggerEnter2D (Collider2D other);

public abstract void OnCollisionEnter2D (Collision2D collision2D);

public abstract void Collect ();

Backgroundblock.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Utilities;

30
namespace RedRunner.TerrainGeneration
{

public class BackgroundBlock : Block


{

[SerializeField]
protected float m_MinWidth = 1f;
[SerializeField]
protected float m_MaxWidth = 10f;

public virtual float MinWidth {


get {
return m_MinWidth;
}
}

public virtual float MaxWidth {


get {
return m_MaxWidth;
}
}

public override float Width {


get {
return base.Width;
}
set {
m_Width = value;
}
}

protected virtual void Start ()


{

Backgroundlayer.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RedRunner.TerrainGeneration
{

[System.Serializable]

31
public struct BackgroundLayer
{

public string name;


public BackgroundBlock[] Blocks;
public BackgroundBlock LastBlock;
public float CurrentX;
public float PreviousX;

public void Reset ()


{
CurrentX = 0f;
PreviousX = 0f;
LastBlock = null;
}

Block.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RedRunner.TerrainGeneration
{

public abstract class Block : MonoBehaviour


{

[SerializeField]
protected float m_Width;
[SerializeField]
protected float m_Probability = 1f;

public virtual float Width {


get {
return m_Width;
}
set {
m_Width = value;
}
}

public virtual float Probability {


get {
return m_Probability;
}
}

public virtual void OnRemove (TerrainGenerator generator)

32
{

public virtual void PreGenerate (TerrainGenerator generator)


{

public virtual void PostGenerate (TerrainGenerator generator)


{

TerrainGeneretor.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using RedRunner.Characters;

namespace RedRunner.TerrainGeneration
{

public abstract class TerrainGenerator : MonoBehaviour


{

private static TerrainGenerator m_Singleton;

public static TerrainGenerator Singleton


{
get
{
return m_Singleton;
}
}

protected Dictionary<Vector3, Block> m_Blocks;


protected Dictionary<Vector3, BackgroundBlock> m_BackgroundBlocks;
protected BackgroundLayer[] m_BackgroundLayers;
protected float m_PreviousX;
protected float m_CurrentX;
protected float m_FathestBackgroundX;
[SerializeField]
protected TerrainGenerationSettings m_Settings;
protected int m_GeneratedStartBlocksCount;
protected int m_GeneratedMiddleBlocksCount;
protected int m_GeneratedEndBlocksCount;

33
[SerializeField]
protected float m_DestroyRange = 100f;
[SerializeField]
protected float m_GenerateRange = 100f;
[SerializeField]
protected float m_BackgroundGenerateRange = 200f;
[SerializeField]
protected Character m_Character;
protected Block m_LastBlock;
protected BackgroundBlock m_LastBackgroundBlock;
protected float m_RemoveTime = 0f;
protected bool m_Reset = false;

public float PreviousX


{
get
{
return m_PreviousX;
}
}

public float CurrentX


{
get
{
return m_CurrentX;
}
}

public TerrainGenerationSettings Settings


{
get
{
return m_Settings;
}
}

protected virtual void Awake ()


{
if ( m_Singleton != null )
{
Destroy ( gameObject );
return;
}
m_Singleton = this;
m_Blocks = new Dictionary<Vector3, Block> ();
m_BackgroundBlocks = new Dictionary<Vector3, BackgroundBlock> ();
m_BackgroundLayers = new BackgroundLayer[m_Settings.BackgroundLayers.Length];
for ( int i = 0; i < m_Settings.BackgroundLayers.Length; i++ )
{
m_BackgroundLayers [ i ] = m_Settings.BackgroundLayers [ i ];
}
GameManager.OnReset += Reset;

34
}

protected virtual void Reset ()


{
m_Reset = true;
RemoveAll ();
m_CurrentX = 0f;
m_LastBlock = null;
m_LastBackgroundBlock = null;
for ( int i = 0; i < m_BackgroundLayers.Length; i++ )
{
m_BackgroundLayers [ i ].Reset ();
}
m_FathestBackgroundX = 0f;
m_Blocks.Clear ();
m_BackgroundBlocks.Clear ();
m_GeneratedStartBlocksCount = 0;
m_GeneratedMiddleBlocksCount = 0;
m_GeneratedEndBlocksCount = 0;
m_Reset = false;
}

protected virtual void OnDestroy ()


{
m_Singleton = null;
}

protected virtual void Update ()


{
if ( m_Reset )
{
return;
}
if ( m_RemoveTime < Time.time )
{
m_RemoveTime = Time.time + 5f;
Remove ();
}
Generate ();
}

public virtual void Generate ()


{
if ( m_CurrentX < m_Settings.LevelLength || m_Settings.LevelLength <= 0 )
{
bool isEnd = false, isStart = false, isMiddle = false;
Block block = null;
Vector3 current = new Vector3 ( m_CurrentX, 0f, 0f );
float newX = 0f;
if ( m_GeneratedStartBlocksCount < m_Settings.StartBlocksCount || m_Settings.StartBlocksCount <= 0 )
{
isStart = true;
block = ChooseFrom ( m_Settings.StartBlocks );

35
}
else if ( m_GeneratedMiddleBlocksCount < m_Settings.MiddleBlocksCount ||
m_Settings.MiddleBlocksCount <= 0 )
{
isMiddle = true;
block = ChooseFrom ( m_Settings.MiddleBlocks );
}
else if ( m_GeneratedEndBlocksCount < m_Settings.EndBlocksCount || m_Settings.EndBlocksCount <=
0)
{
isEnd = true;
block = ChooseFrom ( m_Settings.EndBlocks );
}
if ( m_LastBlock != null )
{
newX = m_CurrentX + m_LastBlock.Width;
}
else
{
newX = 0f;
}
if ( block != null && ( m_LastBlock == null || newX < m_Character.transform.position.x +
m_GenerateRange ) )
{
if ( isStart )
{
if ( m_Settings.StartBlocksCount > 0 )
{
m_GeneratedStartBlocksCount++;
}
}
else if ( isMiddle )
{
if ( m_Settings.MiddleBlocksCount > 0 )
{
m_GeneratedMiddleBlocksCount++;
}
}
else if ( isEnd )
{
if ( m_Settings.EndBlocksCount > 0 )
{
m_GeneratedEndBlocksCount++;
}
}
CreateBlock ( block, current );
}
}
for ( int i = 0; i < m_BackgroundLayers.Length; i++ )
{
int random = Random.Range ( 0, 2 );
bool generate = random == 1 ? true : false;
if ( !generate )

36
{
continue;
}
Vector3 current = new Vector3 ( m_BackgroundLayers [ i ].CurrentX, 0f, 0f );
BackgroundBlock block = ( BackgroundBlock )ChooseFrom ( m_BackgroundLayers [ i ].Blocks );
float newX = 0f;
if ( m_BackgroundLayers [ i ].LastBlock != null )
{
newX = m_BackgroundLayers [ i ].CurrentX + m_BackgroundLayers [ i ].LastBlock.Width;
}
else
{
newX = 0f;
}
if ( block != null && ( m_BackgroundLayers [ i ].LastBlock == null || newX <
m_Character.transform.position.x + m_BackgroundGenerateRange ) )
{
CreateBackgroundBlock ( block, current, m_BackgroundLayers [ i ], i );
}
}
}

public virtual void Remove ()


{
List<Block> blocksToRemove = new List<Block> ();
foreach ( KeyValuePair<Vector3, Block> block in m_Blocks )
{
if ( block.Value.transform.position.x - m_CurrentX > m_DestroyRange )
{
blocksToRemove.Add ( block.Value );
}
}
List<BackgroundBlock> backgroundBlocksToRemove = new List<BackgroundBlock> ();
foreach ( KeyValuePair<Vector3, BackgroundBlock> block in m_BackgroundBlocks )
{
if ( block.Value.transform.position.x - m_FathestBackgroundX > m_DestroyRange )
{
backgroundBlocksToRemove.Add ( block.Value );
}
}
for ( int i = 0; i < blocksToRemove.Count; i++ )
{
RemoveBlock ( blocksToRemove [ i ] );
}
for ( int i = 0; i < backgroundBlocksToRemove.Count; i++ )
{
RemoveBackgroundBlock ( backgroundBlocksToRemove [ i ] );
}
}

public virtual void RemoveAll ()


{
List<Block> blocksToRemove = new List<Block> ();

37
foreach ( KeyValuePair<Vector3, Block> block in m_Blocks )
{
blocksToRemove.Add ( block.Value );
}
List<BackgroundBlock> backgroundBlocksToRemove = new List<BackgroundBlock> ();
foreach ( KeyValuePair<Vector3, BackgroundBlock> block in m_BackgroundBlocks )
{
backgroundBlocksToRemove.Add ( block.Value );
}
for ( int i = 0; i < blocksToRemove.Count; i++ )
{
RemoveBlock ( blocksToRemove [ i ] );
}
for ( int i = 0; i < backgroundBlocksToRemove.Count; i++ )
{
RemoveBackgroundBlock ( backgroundBlocksToRemove [ i ] );
}
}

public virtual void RemoveBlockAt ( Vector3 position )


{
RemoveBlock ( m_Blocks [ position ] );
}

public virtual void RemoveBlock ( Block block )


{
block.OnRemove ( this );
Destroy ( m_Blocks [ block.transform.position ].gameObject );
m_Blocks.Remove ( block.transform.position );
}

public virtual void RemoveBackgroundBlock ( BackgroundBlock block )


{
block.OnRemove ( this );
Destroy ( m_BackgroundBlocks [ block.transform.position ].gameObject );
m_BackgroundBlocks.Remove ( block.transform.position );
}

public virtual bool CreateBlock ( Block blockPrefab, Vector3 position )


{
if ( blockPrefab == null )
{
return false;
}
blockPrefab.PreGenerate ( this );
Block block = Instantiate<Block> ( blockPrefab, position, Quaternion.identity );
m_PreviousX = m_CurrentX;
m_CurrentX += block.Width;
m_Blocks.Add ( position, block );
blockPrefab.PostGenerate ( this );
m_LastBlock = block;
return true;
}

38
public virtual bool CreateBackgroundBlock ( BackgroundBlock blockPrefab, Vector3 position,
BackgroundLayer layer, int layerIndex )
{
if ( blockPrefab == null )
{
return false;
}
blockPrefab.PreGenerate ( this );
position.z = blockPrefab.transform.position.z;
position.y = blockPrefab.transform.position.y;
BackgroundBlock block = Instantiate<BackgroundBlock> ( blockPrefab, position, Quaternion.identity );
float width = Random.Range ( block.MinWidth, block.MaxWidth );
m_BackgroundLayers [ layerIndex ].PreviousX = m_BackgroundLayers [ layerIndex ].CurrentX;
m_BackgroundLayers [ layerIndex ].CurrentX += width;
block.Width = width;
m_BackgroundLayers [ layerIndex ].LastBlock = block;
m_BackgroundBlocks.Add ( position, block );
blockPrefab.PostGenerate ( this );
if ( m_BackgroundLayers [ layerIndex ].CurrentX > m_FathestBackgroundX )
{
m_FathestBackgroundX = m_BackgroundLayers [ layerIndex ].CurrentX;
}
return true;
}

public Block GetCharacterBlock ()


{
Block characterBlock = null;
foreach ( KeyValuePair<Vector3, Block> block in m_Blocks )
{
if ( block.Key.x <= m_Character.transform.position.x && block.Key.x + block.Value.Width >
m_Character.transform.position.x )
{
characterBlock = block.Value;
break;
}
}
return characterBlock;
}

public static Block ChooseFrom ( Block[] blocks )


{
if ( blocks.Length <= 0 )
{
return null;
}
float total = 0;
for ( int i = 0; i < blocks.Length; i++ )
{
total += blocks [ i ].Probability;
}
float randomPoint = Random.value * total;

39
for ( int i = 0; i < blocks.Length; i++ )
{
if ( randomPoint < blocks [ i ].Probability )
{
return blocks [ i ];
}
else
{
randomPoint -= blocks [ i ].Probability;
}
}
return blocks [ blocks.Length - 1 ];
}

TerrainGeneraorSettings.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RedRunner.TerrainGeneration
{

[CreateAssetMenu (menuName = "Create Terrain Generator Settings")]


public class TerrainGenerationSettings : ScriptableObject
{

[SerializeField]
protected float m_LevelLength = 200f;
[SerializeField]
protected int m_StartBlocksCount = 1;
[SerializeField]
protected int m_MiddleBlocksCount = -1;
[SerializeField]
protected int m_EndBlocksCount = 1;
[SerializeField]
protected Block[] m_StartBlocks;
[SerializeField]
protected Block[] m_MiddleBlocks;
[SerializeField]
protected Block[] m_EndBlocks;
[SerializeField]
protected BackgroundLayer[] m_BackgroundLayers;

public float LevelLength {


get {
return m_LevelLength;
}
}

40
public int StartBlocksCount {
get {
return m_StartBlocksCount;
}
}

public int MiddleBlocksCount {


get {
return m_MiddleBlocksCount;
}
}

public int EndBlocksCount {


get {
return m_EndBlocksCount;
}
}

public Block[] StartBlocks {


get {
return m_StartBlocks;
}
}

public Block[] MiddleBlocks {


get {
return m_MiddleBlocks;
}
}

public Block[] EndBlocks {


get {
return m_EndBlocks;
}
}

public BackgroundLayer[] BackgroundLayers {


get {
return m_BackgroundLayers;
}
}

41
CHAPTER 7. VALIDATION CHECKS

Score Validation
When player collides with fruit the score board should maintain the consistency of score.
ex: score=3 on collides with fruit the score should incremented by 1 i.e.; score=4;

Restart Validation
when Player drowned in water or player collides with danger obstacles the game should not end
it should give the option Restart to user.

User Validation
User Can play by login/guest mode so that it would be easy to access game in a less runtime;

On click Validation
It should give the option to user like exit home and restart and it should redirect as per
the choice.

Game files Validation


If you are having problems with game, Admin should validate the game assets and required files
both through the Unity Dashboard.

42
CHAPTER 8. IMPLEMENTATION AND MAINTENANCE
System Implementation Six major activities
• Coding
• Testing
• Installation
• Documentation
• Support
The Process of Coding, Testing and Installation

Coding
Physical design specifications are turned into working computer code
Testing
Tests are performed using various strategies
• Testing can be performed in parallel with coding

Installation
Process during which the current system is replaced by the new system

Managing Programming
Project Manager’s Tasks during Programming
1. The Programmer Paradox
• More is not always better than less!
• After the “right” number of people are assigned to a programming task, adding more
people slow down rather than speeds up completion of the project.
• Projects requiring a large team should be broken into a series of independent, smaller parts.

Coordinating Activities
• Weekly (hopefully brief) meetings
• Create and follow standards
• Organize programmer’s work areas
• Development area
• Testing area
• Production area
• Implement change control mechanisms

43
• Use program log to monitor program changes

Managing the Schedule


• Use initial time estimates as a baseline
• Revise time estimates as construction proceeds
• Fight against scope creep
• Monitor “minor” slippage

DESIGNING TESTS

System Testing
• Requirements Testing
– Ensures that integration did not cause new errors
• Usability Testing
– Tests how easy and error-free the system is in use
• Security Testing
– Assures that security functions are handled properly
• Performance Testing
– Assures that the system works under high volumes of activity
• Documentation Testing
– Analysts check the accuracy of documentation
Acceptance Testing
• Alpha Testing
– Performed by users to assure they accept the system;
frequently repeats earlier tests
• Beta Testing
– Uses real data, not test data. Actual users monitor for errors or needed improvements.

Developing Documentation
• User Documentation
– Intended to help users operate the systems
Producing Documentation
• High quality documentation takes about 3 hours per page or 2 hours per screen.
• The task should not be left to the end of the project.

44
• Time required to develop, and test user documentation should be built into project plan.
• On-line documentation is growing in importance.

Maintaining information systems


Measures of Effectiveness
• Number of failures
• Time between each failure
• Type of failure
• Mean time between failures (MTBF)
– A measurement of error occurrences that can be tracked over time to indicate the quality of
a system

Platform Maintenance
• Special considerations (continued)
– Re-registration
• When content significantly changes, site may need to be re-registered with search engines
– Future Editions
• Consistency is important to users
• Post indications of future changes to the site
• Batch changes

45
CHAPTER 9. TESTING (TESTING TECHNIQUES AND TESTING
STRATEGIES)

Functional Testing
Function testing verifies that each function of the software application operates in
conformance with the requirement specification. The testing mainly involves black box
testing and it is not concerned with the source code. The functionality of the system by
providing appropriate input, verifying the output and comparing the actual result with
expected result.
Functional testing can be performed on survival of the fastest to check that the appropriate output
is coming from the input provided. Each Activity in Survival of the fastest include validation in
which the next activity is depend upon the user choice.

Structural Testing
The structural testing is the testing of the structure of the system or component. Structural testing
is often referred to as ‘white box’ or ‘glass box’ or ‘clear-box testing’ because in structural
testing, testing is done to check what is happening inside the system. In structural testing the
testers are required to have the knowledge of the internal implementations of the code. Here the
testers require knowledge of how the software is implemented, how it works.

In Survival of the fastest structural testing is done to check how the loops in the software are
working. Different test cases may be derived to exercise the loop once, twice, and many times.
This may be done regardless of the functionality of the software. Structural testing checks
whether the code written is correct or not. The code in tour and travel is written correctly and is
error free. It checks that the menu option is working properly or not. And all the menu Items
including the correct link to the correct from.

Levels of Testing
There are different levels during the process of Testing. Levels of testing include the different
methodologies that can be used while conducting Software Testing. Following are the main
levels of Software Testing:

• Functional Testing.
• Non-Functional Testing.

46
Functional Testing
Functional testing can be performed on survival of the fastest to check that the appropriate output
is coming from the input provided. Each Activity in Survival of the fastest include validation in
which the next activity is depend upon the user choice.

• Unit Testing
Is this testing is done by the developers on the individual units of source code assigned
area. The developers use test data that is separate from the test data of the quality
assurance team. The goal of unit testing is to isolate each part of the program and show
that individual parts are correct in terms of requirements and functionality.

In this we have tested every module separately just to know that they are working
properly and giving the desired output.
• Integration Testing

The testing of combined parts of an application to determine if they function correctly


together is Integration testing.

In this phase of testing we are emphasizing on how two or more applications or functions
are working with each other. like how they are activities are depending upon each other,
which activity is come under which module.

• System Testing

This is the next level in the testing and tests the system as a whole. Once all the
components are integrated, the application as a whole is tested rigorously to see that it
meets Quality Standards.
This type of testing is performed by a specialized testing team.
System testing is so important because of the following reasons:

System Testing is the first step in the Software Development Life Cycle, where the
application is tested.
The application is tested thoroughly to verify that it meets the functional and technical
specifications.
The application is tested in an environment which is very close to the production
environment where the application will be deployed.

47
System Testing enables us to test, verify and validate both the business requirements as
well as the Applications Architecture.

• Alpha Testing

This test is the first stage of testing and will be performed amongst the teams
(developer and QA teams). Unit testing, integration testing and system testing when
combined are known as alpha testing. During this phase, the following will be tested in
the application:
▪ Spelling Mistakes
▪ Broken Links
▪ Cloudy Directions
▪ The Application will be tested on machines with the lowest specification
to test loading times and any latency problems.
• Beta Testing
This test is performed after Alpha testing has been successfully performed. In beta
testing a sample of the intended audience tests the application. Beta testing is also
known as pre-release testing. Beta test versions of software are ideally distributed to a
wide audience on the Web, partly to give the program a "real-world" test and partly to
provide a preview of the next release. In this phase the audience will be testing the
following

• Getting the feedback, the project team can fix the problems before releasing the software
to the actual users.
• The more issues you fix that solve real user problems, the higher the quality of your
application will be.
• Having a higher-quality application when you release to the general public will increase
customer satisfaction.

Non-Functional Testing
This section is based upon the testing of the application from its non-functional attributes.
Non-functional testing of Software involves testing the Software from the requirements which
are non-functional in nature related but important a well such as performance, security, user
interface etc. Some of the important and commonly used non-functional testing types are
mentioned as follows:

48
i. Performance Testing

It is mostly used to identify any bottlenecks or performance issues rather than finding the bugs in
software. There are different causes which contribute in lowering the performance of software:

• Network delay.

• Client-side processing.

• Database transaction processing.

• Load balancing between servers.

• Data rendering.
Performance testing is considered as one of the important and mandatory testing types in terms
of following aspects:

• Speed (i.e. Response Time, data rendering and accessing)


• Capacity
• Stability
• Scalability

49
CHAPTER 10. SYSTEM SECURITY AND MEASURES

Games are a great way to kill the time and most of you probably already played video games.
Some of you have already been tempted to cheat in video game because somehow, they find it
funnier like this. There is a lot of kind of games over internet. Some of them are even playable
under your browser. To speak about the most famous technologies used right now, we have
Flash, Html5 and Unity3D. Today, we’ll be talking about scoring games. More exactly, we’ll be
talking about scoring game made with the game engine Unity 3D.

Theory and Method of Exploitation


Now we know most of games are client based, what if we could get that client and extract it?
Extracting a game will give us all its resources (textures, animation, scripts, etc.). Since we’re
aiming to cheat our score, we will concentrate on extracting the scripts. Considering the client
has authority, it must contain the endpoint and methods to send the score to an API which will
update the scoreboard.

No more talking, let’s see what we can do!

Practice and Methodology Step-By-Step


For this example, I will apply this tutorial on a real game from a website with 30k+ active users.
Since this this has not been fixed yet, I will replace sensitive data by fake ones, but all the
process and ideas are stayed intact.

Let’s find a web player game made with unity on the internet. We've found a scoring game
named “Rookie Jump” over the internet, graphics looks cool, but something is wrong. When we
look at the scoreboard, two peoples are over 1 million points and others player from the top 100
can't pass the cap of 100000.

Is that game “hack-able”? I would say, yes!

The website is asking me to create an account in order to save my progress and score on the
scoreboard. Let’s do so... Ok, the account is made now let’s open your browser developer tools
(F12) and look for a file with an extension of “. unity3d”. We’ve found the file
WebPlayer.unity3d.

50
CHAPTER 11. VARIOUS TYPES OF MODULES

Modules
• play
• pause
• restart
• exit
• home
• share
• loading
• jump
• move forward and backward
• collect coins
• display score

Play: -
The modules/function in which user can play the game that includes move jump etc;
Pause:-
It is a module to pause the gameplay when user have some other work to do .
Restart:-
The module that restart the gameplay when user fails to play(Get out);
Exit :-
The module that exit the gameplay while playing the game in order to exit user first needs to
press Pause
and click Exit.
Home:-
The module that will redirect you to main menu/home in the game.
Share :-
It gives you an option to share the game with friends and play with them.
loading :-
It is the first phase in the gameplay that loads the required files to play the game.
Move forward backward and Jump :-
The module that in which user can play as per the gameplay by moving forward and backward
and jump to escape from the obstacles.
Collect Coins and display score:-
In these the player collects the coins and score should be displayed in the screen.

51
CHAPTER 12. FUTURE SCOPE OF THE PROJECT

• Add different skins/color to the player. Customize player outfit and background of the
game like Normal mode, Night mode.
• Add differ obstacles to the game.
• Implement Multiplayer gaming to play with friends.
• Add different levels to the game.
• Implement weapon to player to attack from obstacles.
• Add different outfit(buy) to user. Add super power like skateboard to the player when it
consumes the special power.
• Add Challenges/Achievements to complete those.

52

You might also like