Skip to content

Knight's Adventure is 2D platformer game made with Unity for PC

Notifications You must be signed in to change notification settings

BatuhanDemiray/Knights-Adventure

Repository files navigation

Knight's Adventure

Knight's Adventure is 2D side-scroller platformer game made with Unity for PC

This game is a project I made to learn a new technology and improve myself during my IT internship in 2021. In this first serious game I designed using the Unity game engine, Sprite Sheets are taken from open source sources from the internet, but there is no problem for personal use.

Table of Contents

(Click to Expand or Hide)
  1. Opening/Title Screen
    1. Language Screen
    2. Key Bindings Screen
  2. Main Character
    1. Anim Cycle
  3. Level - 1
    1. Enemy Objects at Level - 1
  4. Level - 2
    1. Enemy Objects at Level - 2
  5. HUD
    1. Paused Screen
    2. Health Bar
    3. Coin Canvas
  6. Collectibles
    1. Coin
    2. Health Potion
  7. Camera Follow System
  8. Contact

Opening/Title Screen


Language Screen


There are 2 language options in the game, one of them is Turkish and the other is English. The language is changed instantly when the buttons are clicked. The system I use for this localization process is Lean Localization.

Key Bindings


Main Character


Anim Cycle


Level - 1


Enemy Objects at Level - 1

Level - 2


Enemy Objects at Level - 2

HUD

There are 3 elements on the screen as the HUD Screen. These are Pause Button, Health Bar and Coin Canvas.

Paused Screen


Resume, Restart and Exit operations can be performed in this menu that opens when the Pause Button is clicked.

 public void RestartGame(){
      Scene scene = SceneManager.GetActiveScene();
      SceneManager.LoadScene(scene.name);
      Time.timeScale = 1.0f;
 }

public void PauseGame(){
    isGamePaused = !isGamePaused;

    if (isGamePaused == true){
        Time.timeScale = 0.0f;
        pauseGame.SetActive(true);
    }
    else{
        Time.timeScale = 1.0f;
        pauseGame.SetActive(false);
    }     
}

public void ExitGame(){
    SceneManager.LoadScene("Scenes/OpeningScene");
    Time.timeScale = 1.0f;
}

Health Bar


The area where the health status of our character is displayed on the screen.

  void UpdateUI(){
      healthBar.value = player.currentPlayerHealth;
      if (player.currentPlayerHealth <= 0)
          healthBar.minValue = 0;
  }

Coin Canvas


The area where the amount of coin collected by our character is displayed on the screen.

Collectibles

There are 2 collectible objects in the game. These are coin and health potions.

Coin


The coin found at different points in the game, instead of appearing on the screen in a fixed way, has a more pleasant appearance by making a rotation animation around itself.

Health Potion


This object, which helps to increase the health of our character, can be found in various parts of the game.

  void BoostHealth(){
      if (addHealth)
      {
          currentPlayerHealth += giveHealth.health;
          addHealth = false;
          audioSource.PlayOneShot(audioHealth);
      }
  }

Camera Follow System

I used a package called Cinemachine for our character to be followed by the camera.


Information

Batuhan Demiray

Pamukkale University - Computer Engineering

Contact Me on Linkedin | Facebook

About

Knight's Adventure is 2D platformer game made with Unity for PC

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages