Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = System.getUsername()
- pad = Controls.read()
- console = Console.new(TOP_SCREEN)
- response = ""
- print("Hello " .. user .. "!")
- print("You are in a house. What do you do?")
- print("1: Eat food. PRESS UP")
- print("2: Watch TV. PRESS DOWN")
- print("3: Run away. PRESS LEFT")
- print("4: Call a friend. PRESS RIGHT")
- while true do
- if (Controls.check(pad, KEY_DUP)) then
- response = "eat"
- break
- end
- if (Controls.check(pad, KEY_DDOWN)) then
- response = "tv"
- break
- end
- if (Controls.check(pad, KEY_DLEFT)) then
- response = "run"
- break
- end
- if (Controls.check(pad, KEY_DRIGHT)) then
- response = "call"
- break
- end
- end
- if (response == "eat") then
- print("You ate a hearty meal. Now what do you do?")
- print("1: Exit the game. PRESS UP")
- print("2: Exit the game. PRESS DOWN")
- print("3: Exit the game. PRESS LEFT")
- print("4: Exit the game. PRESS RIGHT")
- end
- if (response == "tv") then
- print("You watched TV. Now what do you do?")
- print("1: Exit the game. PRESS UP")
- print("2: Exit the game. PRESS DOWN")
- print("3: Exit the game. PRESS LEFT")
- print("4: Exit the game. PRESS RIGHT")
- end
- if (response == "run") then
- print("You ran away. Now what do you do?")
- print("1: Exit the game. PRESS UP")
- print("2: Exit the game. PRESS DOWN")
- print("3: Exit the game. PRESS LEFT")
- print("4: Exit the game. PRESS RIGHT")
- end
- if(response == "call") then
- print("You called a friend. Now what do you do?")
- print("1: Exit the game. PRESS UP")
- print("2: Exit the game. PRESS DOWN")
- print("3: Exit the game. PRESS LEFT")
- print("4: Exit the game. PRESS RIGHT")
- end
- function print(text)
- Console.append(console, text)
- end
Advertisement
Add Comment
Please, Sign In to add comment