Advertisement
pivotraze

Instructions Script

Dec 2nd, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
BOO 1.81 KB | None | 0 0
  1. /* This script is licensed under the BSD license.
  2. Author: Cody Dostal
  3. Author Email: allysman21@gmail.com
  4. Date Written: 4/22/2012
  5. Date Last Edited: 4/24/2012
  6. Engine Version: 3.5.1f2
  7. Script Version: v1.1
  8. */
  9.  
  10. /* NOTE: With good chance, you may have to change any hard-coded values in these scripts.
  11. These values work with my version, and may not with your version. */
  12.  
  13. import UnityEngine
  14.  
  15. class Instructions1 (MonoBehaviour):
  16.  
  17.     // Setting up strings for the Instruction screen.
  18.     private infoText as string = "Controls: \n Press left, right, up, and down arrows to move. \n Press Spacebar, Right Control, or your Left Mouse Button to fire. \n Press Left Shift to speed up, and Left Control to slow down."
  19.     private pntText as string = "Points: \n You gain points by destroying Meteors. \n You lose 300 points by dying. \n You lose 100 points by missing a meteor."
  20.     private winLose as string = "How to Win: \n You win by getting 5000 points. \n You lose only if you lose all your lives."
  21.  
  22.     // Setting up variables for the labels. Found in Editor, changed to private and set in here.
  23.     private infoHeight as single = 150
  24.     private infoWidth as single = 250
  25.    
  26.     private pntHeight as single = 150
  27.     private pntWidth as single = 250
  28.    
  29.     private winLoseHeight as single = 150
  30.     private WinLoseWidth as single = 250
  31.  
  32.     def OnGUI ():
  33.         GUI.Label(Rect(140, 10, infoWidth, infoHeight), infoText)
  34.         GUI.Label(Rect(140, 135, pntWidth, pntHeight), pntText)
  35.         GUI.Label(Rect(140, 220, infoWidth, infoHeight), winLose)
  36.        
  37.         // If you click the "Menu" button, load the Menu   
  38.         if GUI.Button(Rect(Screen.width - 125, Screen.height - 75, 100, 50), "Menu"):
  39.             Application.LoadLevel(0)
  40.            
  41.         // If you click the "Start" button, load the game.
  42.         if GUI.Button(Rect(10, Screen.height -75, 100, 50), "Start!"):
  43.             Application.LoadLevel(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement