Monday, 5 May 2014

Steampunk: Game Menu (Update)

Here i have been flowing atutorial on how to make a game menu following this step-by-step videoand using the code provided below I use this and implemented it in my main menu for the game environment in his he only has two start and except but from my ninth hoping to add a fly through option which will allow the player to be on a fixed path and see parts of the environment he would not probably find  by themselves.


and also using the code below in the game menu

var isQuit=false;

function OnMouseEnter(){
//change text color
renderer.material.color=Color.red;
}

function OnMouseExit(){
//change text color
renderer.material.color=Color.white;
}

function OnMouseUp(){
//is this quit
if (isQuit==true) {
//quit the game
Application.Quit();
}
else {
//load level
Application.LoadLevel(1);
}
}

function Update(){
//quit game if escape key is pressed
if (Input.GetKey(KeyCode.Escape)) { Application.Quit();
}
}

with this code the text colour will change as the mouse hangs over it as u can see in the pictures below.


No comments:

Post a Comment