Advertisement
Guest User

Quiz (text101)

a guest
May 29th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.43 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4.  
  5. public class Quiz : MonoBehaviour {
  6.  
  7.     public Text text;
  8.    
  9.     private enum States {room,question_0,question_1,question_2,question_3,question_4,question_5,question_6,question_7,question_8,question_9,wrong,won};
  10.     private States myState;
  11.  
  12.     // Use this for initialization
  13.     void Start () {
  14.         myState = States.room;
  15.    
  16.     }
  17.    
  18.     // Update is called once per frame
  19.     void Update () {
  20.         print (myState);
  21.         if (myState == States.room) {state_room ();}
  22.         else if (myState == States.question_0) {state_question_0();}
  23.         else if (myState == States.question_1) {state_question_1();}
  24.         else if (myState == States.question_2) {state_question_2();}
  25.         else if (myState == States.question_3) {state_question_3();}
  26.         else if (myState == States.question_4) {state_question_4();}
  27.         else if (myState == States.question_5) {state_question_5();}
  28.         else if (myState == States.question_6) {state_question_6();}
  29.         else if (myState == States.question_7) {state_question_7();}
  30.         else if (myState == States.question_8) {state_question_8();}
  31.         else if (myState == States.question_9) {state_question_9();}
  32.         else if (myState == States.wrong) {state_wrong();}
  33.         else if (myState == States.won) {state_won();}
  34.    
  35.     }
  36.     void state_room () {
  37.          text.text = "This is a Blockhead Quiz all questions will " +
  38.                      "be true or false type and it isnt gonna be easy. \n\n" +
  39.                      "Press T for True and F for False and S to Start";
  40.          
  41.         if (Input.GetKey(KeyCode.S)){myState = States.question_0;}
  42.     }
  43.     void state_question_0 () {
  44.         text.text = "This is your first Question hence it is easy\n\n" +
  45.                     "To Spawn the Blockhead after your 3rd you need 150tc ?" ;
  46.        
  47.         if (Input.GetKey(KeyCode.F)){myState = States.question_1;}
  48.         else if (Input.GetKey(KeyCode.T)){myState = States.wrong;}  
  49.     }
  50.     void state_question_1 () {
  51.          text.text = "Red COLOR is not very RARE among Tulips in Blockheads";
  52.          
  53.         if (Input.GetKey(KeyCode.F)){myState = States.wrong;}
  54.         else if (Input.GetKey(KeyCode.T)){myState = States.question_2;}
  55.     }
  56.     void state_question_2 () {
  57.          text.text = "The Ownership sing Protects an AREA of 35 by 35 blocks in all directions";
  58.          
  59.         if (Input.GetKey(KeyCode.T)){myState = States.wrong;}
  60.         else if (Input.GetKey(KeyCode.F)){myState = States.question_3;}
  61.     }
  62.     void state_question_3 () {
  63.         text.text = "The Ownership sing Protects an AREA of 35 by 35 blocks in all directions";
  64.        
  65.         if (Input.GetKey(KeyCode.T)){myState = States.wrong;}
  66.         else if (Input.GetKey(KeyCode.F)){myState = States.question_4;}
  67.     }
  68.     void state_question_4 () {
  69.          text.text = "The SHOP duping Glitch was remove in the 1.5 UPDATE";
  70.          
  71.         if (Input.GetKey(KeyCode.T)){myState = States.wrong;}
  72.         else if (Input.GetKey(KeyCode.F)){myState = States.question_5;}
  73.     }
  74.     void state_question_5 () {
  75.          text.text = "UNKNOWNS started to be popular in the 1.6 update";
  76.          
  77.         if (Input.GetKey(KeyCode.F)){myState = States.wrong;}
  78.         else if (Input.GetKey(KeyCode.T)){myState = States.question_6;}
  79.     }
  80.     void state_question_6 () {
  81.          text.text = "CLOUD servers were added in 1.5.2";
  82.          
  83.         if (Input.GetKey(KeyCode.F)){myState = States.wrong;}
  84.         else if (Input.GetKey(KeyCode.T)){myState = States.question_7;}
  85.     }
  86.     void state_question_7 () {
  87.          text.text = "Kelp was added in 1.3";
  88.          
  89.         if (Input.GetKey(KeyCode.T)){myState = States.wrong;}
  90.         else if (Input.GetKey(KeyCode.F)){myState = States.question_8;}
  91.     }
  92.     void state_question_8 () {
  93.          text.text = "Credit of 30 days cost $8.99";
  94.          
  95.         if (Input.GetKey(KeyCode.F)){myState = States.wrong;}
  96.         else if (Input.GetKey(KeyCode.T)){myState = States.question_9;}
  97.     }
  98.     void state_question_9 () {
  99.          text.text = "You got 9 Questions right think u can answer this\n\n " +
  100.                      "FISHES were there from the first update of blockheads?" ;
  101.                      
  102.          if (Input.GetKey(KeyCode.T)){myState = States.wrong;}
  103.          else if (Input.GetKey(KeyCode.F)){myState = States.won;}  
  104.     }
  105.     void state_wrong () {
  106.          text.text = "Oooooooo.......... it looks like you have answered wrong, Please think of donating Mgnc.\n\n" +
  107.                      "This is made by May3333. \n\n" +
  108.                      "if u wanna play again the PRESS R";
  109.                      
  110.         if (Input.GetKey(KeyCode.R)){myState = States.room;}
  111.     }
  112.     void state_won () {
  113.          text.text =  "Wow............you answered all my questions kewl..\n\n" +
  114.                       "PLEASE THINK OF DONATING MGNC \n\n" +
  115.                       "TO BUY THE CODE CONTACT ME" +
  116.                       "MADE BY MAY3333";
  117.     }
  118. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement