I thought it would be a good idea to start off by posting simple programs. Here is a Y/N crystal ball:
– Crystal Ball
-- Use this function to perform your initial setup
function setup()
displayMode(FULLSCREEN)
responses = {
"Yes.",
"No.",
"Maybe.",
"It's Probable.",
"Definetly.",
"I Doubt It",
"I am not sure."
-- You may add more responses
}
answer = "Shake the iPad for an answer!"
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(49, 49, 89, 255)
fill(0, 255, 232, 255)
font("Didot-Italic")
fontSize(24)
text("Ask the Crystal Ball a Yes or No Question!", WIDTH/2, HEIGHT-100)
fontSize(48)
text(answer, WIDTH/2, HEIGHT/2)
if (UserAcceleration.z > 1.5) then
answer = responses[math.random(#responses)]
end
end