Bomb Voyage

NameBomb Voyage
Short DescriptionA game about causing destruction by playing with explosives.
CategorySchool Project - Year 1
DateFeb - Jul 2015 (~5 months)
EngineUnity
RoleProgrammer
Team Size11

About

Bomb Voyage is a physics-based game in which you are tasked with placing explosives to blow up buildings and more. This was a project I worked on during my first year at NHTV and won the “Best Game” award there.

The Project

Bomb Voyage was the first real game I worked on in Unity. Before this, there were some other Unity projects, but those were projects to learn how the engine works. In this project, I worked on the shields, level functionality, level goals, achievements and various other things.

At the end of the project, Bomb Voyage won the “Best Game” award from the teaching staff at NHTV.

C# Programming

Because Bomb Voyage is a Unity game, we worked in C#. I worked on many different aspects of the game.

I worked on many different aspects of the game. One of the elements in the game I worked on is the “shields” which are areas the player is not allowed to place bombs in or on. This is the code I used to prevent this from happening.

Placement checking
// Place bombs
if (Physics.Raycast(ray, out hit, 1000) && mbCanPlaceBomb && !UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
{
	//don't place buttons on left when on android
	if (Input.mousePosition.x > PositionEnum.miCameraButtonX && Input.mousePosition.y < PositionEnum.miCameraButtonY && Application.platform == RuntimePlatform.Android)
		return;

	Vector3 roundPosition = new Vector3(Mathf.RoundToInt(hit.point.x), Mathf.RoundToInt(hit.point.y) + 0.5f, Mathf.RoundToInt(hit.point.z));

	//don't place on blocking areas
	for (int i = 0; i < noPlaceAreas.Length; i++)
	{
		if (noPlaceAreas[i].GetComponent<Collider>().bounds.Contains(roundPosition))
			return;
	}

	//check if clear
	Vector3 cameraPos = Camera.main.transform.position;

	bool isClear = true;

	for (int i = 0; i < noPlaceAreas.Length; i++)
	{
		if (noPlaceAreas[i].GetComponent<Collider>().bounds.Contains(cameraPos))
			isClear = false;
	}

	Vector3 mousePos = new Vector3(Input.mousePosition.x, Screen.height - Input.mousePosition.y, Input.mousePosition.z);

	//dont place when clicking button bottom or when clicking on the GUI
	if(miBombCount > 0 && mBombPlaceButton.Contains(mousePos))
			isClear = false;

	if (isClear)
	{
		mgGhostBomb.transform.position = roundPosition;

		if (Input.GetMouseButtonDown(0) && miBombCount < miMaxBombs - 1 && miBombsLeft[miCurrentSelectedBomb] > 0)
		{
			//spawn bomb
			GameObject bomb = (GameObject)GameObject.Instantiate(mgBombsToPlace[miCurrentSelectedBomb]);

			bomb.transform.position = hit.point;
			bomb.transform.position = new Vector3(Mathf.RoundToInt(bomb.transform.position.x), Mathf.RoundToInt(bomb.transform.position.y) + 0.5f, Mathf.RoundToInt(bomb.transform.position.z));
			
			bomb.transform.GetComponent<Bomb>().mbPlacedByPlayer = true; // Bomb is now set as 'Placed by player' so it can be removed
			bomb.GetComponent<Bomb>().miBombTypeNumber = miCurrentSelectedBomb;
			mgBombs[miBombCount] = bomb;
			miBombCount++;
			miBombsLeft[miCurrentSelectedBomb]--;
			bombsPlaced++;

			GetNewCurrentSelectedBomb();

			ProgressLogger.AddBombPlaced();

			if (miBombsLeft[miCurrentSelectedBomb] <= 0)
				mgGhostBomb.GetComponent<Renderer>().enabled = false;
			else
				mgGhostBomb.GetComponent<Renderer>().enabled = true;
		}
	}
}

 

Another part of the game I worked on is the UI. This is the code which handles one of the objectives.

UI
float percentage = (100.0f / mWinLose.miTotalBlocks) * mWinLose.miBlocksOnGround;

inGameObjectiveTexts[i].text = percentage.ToString("F1") + "% / " + mWinLose.GetBlockPercentaceToWin() + "%";

if (percentage < mWinLose.GetBlockPercentaceToWin())
{
	msObjectiveText[i] = "Blocks on the ground: " + percentage.ToString("F1") + "% / " + mWinLose.GetBlockPercentaceToWin() + "%";

	inGameObjectiveImages[i].gameObject.SetActive(false);

	if (ReplayManager.mbIsPlaying)
	{
		msObjectiveText[i] = "Take down " + mWinLose.GetBlockPercentaceToWin() + "% of all the blocks!";
		mbHasPlayedBlocksWin = false;

		if (!mbHasPlayedBlocksLost)
		{
			mbHasPlayedBlocksLost = true;
			if (!mbPlayedLostSound) 
			{
				mAudioPlayer.PlaySound(maFailedObjectiveSound);
				mbPlayedLostSound = true;
			}

			GameOver_UI(true);
		}
	}
}
else
{
	msObjectiveText[i] = "Take down " + mWinLose.GetBlockPercentaceToWin() + "% of all the blocks!";
	mbObjectivesPassed[i] = true;

	mbHasPlayedBlocksLost = false;

	//text update
	inGameObjectiveImages[i].gameObject.SetActive(true);
	inGameObjectiveImages[i].sprite = fullTick;

	if (!mbHasPlayedBlocksWin)
	{
		mbHasPlayedBlocksWin = true;
		mAudioPlayer.PlaySound(maFinishObjectiveSound);
	}
}

 

Screenshots & Download

  • Bomb Voyage Level Select
    Bomb Voyage Level Select
  • A level during build phase
    A level during build phase
  • A level during action phase
    A level during action phase
  • The replay system
    The replay system

 

A windows 64-bit version of our game can be downloaded here.