Sunteți pe pagina 1din 11

I.

Game Concept
“ビーチ - Run! (Beach Runner) is 2D runner game for Windows platform that is made in Unity.
It thrust players into the role of a man who is lost in the middle of a paradise.”

The genre of this game is Action: Platform Games, the players navigate their environment by
jumping and climbing on platforms. They often involve unrealistic physics and special
movement abilities. The score is based on he collected coins plus the time left.

II. Game Design


Game Play
In ビーチ - Run! (Beach Runner) players are engaged in to a path with coins and
obstacles. Players use arrow keys to run and jump on the obstacles, collect coins, pass the
obstacles and see how you will pass the obstacles and collect the coins can within the time
given.

Characters
There is only one character in the game, the character is dressed-up like a man from Texas. The
character is quite different from the other characters as it has a unique way of how high he can
jump. The physics for the character is programmed to be like that as it possessed the term of
the game.

Game Play Elements


The character, named Jason, doesn’t have any weapons but it indeed has a special talent which
he can jump high unlike the normal game characters do. For the player to move he has to use
arrow keys that will control how it will run and jump in a certain way that it can reach the coins
and collect them in the given time. The game also used sprites and game models for better
environment.

Game Physics and Statistics


In the game the player may encounter difficulties to run on the obstacles because it is
programmed to be like that. One example is when you fall into a pit, the player will be back at
its starting point, erasing the coins the have earned. The player must slow down on pressing the
arrow keys at may be hard for them to control the character.
2D Art & Animation

GUI

Menu screen (uses text, buttons, pictures)

Game Play Elements


The screenshots below show the all the sprites, models, prefabs, tiles and etc., used in the game.
Sound and Music
Since the game is inspired to the classic Mario Game and Temple Run the sound effects and
music used are also from the game. Like the theme music of Mario Sunshine.

Story
You’ve turn yourself into a mysterious paradise and now you must run for your life and escape
the island. You may encounter unusual things and obstacles. Test your reflexes as you race
down the path in the middle of the beach. Use arrow keys to run and jump to pass the
obstacles, and collect coins to see how far you can run within the time limit.

III. Storyboard
Refer to another sheet.

IV. Screenshots
Actual game screenshots:

Splash Screen
GAME MENU

(ACTUAL GAME)

(ACTUAL GAME)
Source Code:
Main Camera Script

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

//main camera script

public class CameraSystem : MonoBehaviour {

private GameObject player;


public float xMin;
public float xMax;
public float yMin;
public float yMax;

// Use this for initialization


void Start () {
player = GameObject.FindGameObjectWithTag("Player");
}

// Update is called once per frame


void LateUpdate () {
float x = Mathf.Clamp(player.transform.position.x, xMin, xMax);
float y = Mathf.Clamp(player.transform.position.y, yMin, yMax);
gameObject.transform.position = new Vector3(x, y,
gameObject.transform.position.z);

}
}

Player Movement Script

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

//player movement script

public class Player_Move_Ninja : MonoBehaviour


{

// Use this for initialization

public int playerSpeed = 10;


public int playerJumpPower = 1250;
public float moveX;
public bool isGrounded;
public float distanceToBottomOfPlayer = 0.9f;

// Update is called once per frame


void Update(){
PlayerMove();
PlayerRaycast();
}

void PlayerMove(){
//CONTROLS
moveX = Input.GetAxis("Horizontal");
if (Input.GetButtonDown("Jump") && isGrounded == true){
Jump();
}

//ANIMATIONS
if (moveX != 0){
GetComponent<Animator>().SetBool("IsRunning", true);
}
else
{
GetComponent<Animator>().SetBool("IsRunning", false);
}

//PLAYER DIRECTION
if (moveX < 0.0f ){
GetComponent<SpriteRenderer>().flipX = true;
}
else if (moveX > 0.0f ){
GetComponent<SpriteRenderer>().flipX = false;
}
//PHYSICS
gameObject.GetComponent<Rigidbody2D>().velocity = new Vector2(moveX *
playerSpeed, gameObject.GetComponent<Rigidbody2D>().velocity.y);
}
void Jump(){
//JUMPING CODE
GetComponent<Rigidbody2D>().AddForce(Vector2.up * playerJumpPower);
isGrounded = false;
}
void OnCollisionEnter2D (Collision2D col){
//Debug.Log("Player has collided with " + col.collider.name);
if (col.gameObject.tag == "platform")
{
isGrounded = true;
}
}

void PlayerRaycast(){
RaycastHit2D rayUp = Physics2D.Raycast(transform.position, Vector2.up);
if (rayUp != null && rayUp.collider != null && rayUp.distance <
distanceToBottomOfPlayer && rayUp.collider.name == "Box2"){
Destroy(rayUp.collider.gameObject);
}
RaycastHit2D rayDown = Physics2D.Raycast(transform.position, Vector2.down);
if (rayDown != null && rayDown.collider == null && rayDown.distance
<distanceToBottomOfPlayer && rayDown.collider.tag == "enemy")
{
GetComponent<Rigidbody2D>().AddForce(Vector2.up * 1000);

rayDown.collider.gameObject.GetComponent<Rigidbody2D>().AddForce(Vector2.right * 200);
rayDown.collider.gameObject.GetComponent<Rigidbody2D>().gravityScale = 8;
rayDown.collider.gameObject.GetComponent<Rigidbody2D>().freezeRotation =
false;
rayDown.collider.gameObject.GetComponent<BoxCollider2D>().enabled = false;
rayDown.collider.gameObject.GetComponent<EnemyMove>().enabled = false;
Destroy(rayDown.collider.gameObject);
}
if (rayDown != null && rayDown.collider != null && rayDown.distance <
distanceToBottomOfPlayer && rayDown.collider.tag == "enemy") {
isGrounded = true;
}
}
}

Player Health Script

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

//player health script


public class Player_Health : MonoBehaviour
{

public int health;


public bool hasDied;

// Update is called once per frame


void Start(){
hasDied = false;
}

void Update(){
if (gameObject.transform.position.y < -7) {
Die ();
}
}
void Die () {
SceneManager.LoadScene("ninjawarrior");
}
}
Player Score Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

//player score script

public class Player_Score : MonoBehaviour {


private float timeLeft = 60;
public int playerScore = 0;
public GameObject winText;
public GameObject timeLeftUI;
public GameObject playerScoreUI;

void Start()
{
DataManagement.datamanagement.LoadData();
}

// Update is called once per frame


void Update () {
timeLeft -= Time.deltaTime;
timeLeftUI.gameObject.GetComponent<Text>().text = ("Time Left: " +
(int)timeLeft);
playerScoreUI.gameObject.GetComponent<Text>().text = ("Score: " + playerScore);
if (timeLeft < 0.1f)
{
SceneManager.LoadScene("ninjawarrior");
}

}
void OnTriggerEnter2D (Collider2D trig)
{
if (trig.gameObject.name == "EndLevel")
{
winText.SetActive(true);
CountScore();
Destroy(trig.gameObject);
}

if (trig.gameObject.name == "Coins")
{
playerScore += 10;
Destroy(trig.gameObject);
}

}
void CountScore ()
{
playerScore = playerScore + (int)(timeLeft * 10);
DataManagement.datamanagement.highScore = playerScore + (int)(timeLeft * 10);
DataManagement.datamanagement.SaveData();
}
}
Data Management Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

//data management script

public class DataManagement : MonoBehaviour {

public static DataManagement datamanagement;


public int highScore;

void Awake(){
if (datamanagement == null)
{
DontDestroyOnLoad(gameObject);
datamanagement = this;
} else if (datamanagement != this)
{
Destroy(gameObject);
}
}

public void SaveData(){


BinaryFormatter BinForm = new BinaryFormatter(); //creates a bin formatter
FileStream file = File.Create(Application.persistentDataPath + "/gameInfo.dat");
//creates file
gameData data = new gameData(); //creates container for data
data.highScore = highScore;
BinForm.Serialize(file, data); //serializes
file.Close(); //closes file
}

public void LoadData(){


if (File.Exists (Application.persistentDataPath + "/gameInfo.dat"))
{
BinaryFormatter BinForm = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath + "/gameInfo.dat",
FileMode.Open);
gameData data = (gameData)BinForm.Deserialize (file);
file.Close();
highScore = data.highScore;
}
}
}

[Serializable]

class gameData{
public int highScore;
}
End Level Script

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

//end level script

public class GameManager : MonoBehaviour {


public GameObject winText;
public static GameManager instance = null;
private void Awake()
{
if (instance == null)
instance = this;

else if (instance != null)


Destroy(gameObject);

}
public void Win()
{
winText.SetActive(true);
}
}

Menu Control Script

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

//menu script

public class MenuCtrl : MonoBehaviour


{

// Use this for initialization


public void LoadScene(string ninjawarrior)
{
SceneManager.LoadScene(ninjawarrior);
}

public void gameExit()


{
Application.Quit();
}
}
Game Design Document
Elective 2
AY 2017-2018, First Semester

“ビーチ - Run!”
(Beach Runner)

Team Trojan

Biscocho, Erica Joi


Capule, Benz Franklin
Cueto, Mark Lester
Ramos, Manuel
Unico, Darlene

BSIT-3A

October 24, 2017

S-ar putea să vă placă și