Game Programming Lab: Name-Asmt Gupta REG NO.-18BCE0904
Game Programming Lab: Name-Asmt Gupta REG NO.-18BCE0904
Game Programming Lab: Name-Asmt Gupta REG NO.-18BCE0904
LAB FAT
NAME-ASMT GUPTA
REG NO.-18BCE0904
Aim:
To make an ocean environment where player has to collect pearls contained in the shells
and also implementing player health deteriorating system
PROCEDURE:-
1. ADD THE PANEL WITH BACKGROUND IMAGE
2. ADD THE CHARACTER ADD SCRIPT FILE TO IT
3. ADD HEALTH WITH IT SCRIPT FILE
4. ADD ENEMY WITH SCIPT FILE
5. ADD GROUND WITH RIGIB BODY
OUTPUT
CODE:-
Playerctrl.cs
health,cs
using UnityEngine;
using System.Collections;
if (explosionPrefab!=null) {
Instantiate (explosionPrefab, transform.position, Quaternion.i
dentity);
}
switch(onLivesGone)
{
case deathAction.loadLevelWhenDead:
Application.LoadLevel (LevelToLoad);
break;
case deathAction.doNothingWhenDead:
// do nothing, death must be handled in another way elsewh
ere
break;
}
Destroy(gameObject);
}
}
}