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.
(Click to Expand or Hide)
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.
There are 3 elements on the screen as the HUD Screen. These are Pause Button, Health Bar and Coin Canvas.
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;
}
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;
}
The area where the amount of coin collected by our character is displayed on the screen.
There are 2 collectible objects in the game. These are coin and health potions.
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.
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);
}
}
I used a package called Cinemachine for our character to be followed by the camera.
Batuhan Demiray
Pamukkale University - Computer Engineering