Documente Academic
Documente Profesional
Documente Cultură
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.
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.
GUI
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;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
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;
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
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;
void Start()
{
DataManagement.datamanagement.LoadData();
}
}
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;
void Awake(){
if (datamanagement == null)
{
DontDestroyOnLoad(gameObject);
datamanagement = this;
} else if (datamanagement != this)
{
Destroy(gameObject);
}
}
[Serializable]
class gameData{
public int highScore;
}
End Level Script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
}
public void Win()
{
winText.SetActive(true);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
//menu script
“ビーチ - Run!”
(Beach Runner)
Team Trojan
BSIT-3A