This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// This class is used for handeling the life and score of the player.
/// </summary>
int_Score=0;
int_Lives=5;
publicint_Score=0;
publicint_Lives=5;
bool_Shielding=false;
[SerializeField]
Text_LivesText;
[SerializeField]
Text_ScoreText;
newAudioSourceaudio;
// Use this for initialization
voidStart () {
// Use this for initialization
voidStart () {
print("Lives are: "+_Lives);
print("Score is: "+_Score);
audio=GetComponent<AudioSource>();
}
// Update is called once per frame
voidUpdate () {
_ScoreText.text="Score: "+_Score;
_LivesText.text="Lives: "+_Lives;
CheckLives();
}
//This OnCollisionEnter is used to look if it is touching a wall and if so, it compairs the players wallvalue with the wall's wallvalue.
//If it is the same then it wil destroy the wall and adds 100 to the score. Else it wil detract 50 from the score, the wall will be destroyed and the player loses a life
voidOnCollisionEnter2D(Collision2Dcoll)
voidOnTriggerEnter2D(Collider2Dcoll)
{
if (coll.gameObject.tag=="Hole")
{
if (coll.gameObject.GetComponent<WallCounter>()._WallValue==gameObject.GetComponent<Player_ShapeChange>()._ShapeValue)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters