This is all I have so far. It’s mainly just the draw function. The program doesn’t do much. I still need to generate random numbers and operations, program the buttons to display numbers when touched + an enter button and tell the user the right answer if answered wrong. It’s not perfect I know and it can probably be shortened but this is what I have. [Screenshot of my program] http://imgur.com/yGyOCmY
-- MathGame
--Variables
local button0 = "Project:button0"
local button1 = "Project:button1"
local button2 = "Project:button2"
local button3 = "Project:button3"
local button4 = "Project:button4"
local button5 = "Project:button5"
local button6 = "Project:button6"
local button7 = "Project:button7"
local button8 = "Project:button8"
local button9 = "Project:button9"
-- Use this function to perform your initial setup
function setup()
supportedOrientations(LANDSCAPE_ANY)
--displayMode(FULLSCREEN)
noFill()
noSmooth()
noStroke()
pushStyle()
end
-- This function gets called once every frame
function touched(touch)
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
--This displays numbers 0-9 in a keypad fashion on the screen
sprite(button0, WIDTH/2-150, HEIGHT/2-300, 75, 75)
sprite(button1, WIDTH/2-250, HEIGHT/2, 75, 75)
sprite(button2, WIDTH/2-150, HEIGHT/2, 75, 75)
sprite(button3, WIDTH/2-50, HEIGHT/2, 75, 75)
sprite(button4, WIDTH/2-250, HEIGHT/2-100, 75, 75)
sprite(button5, WIDTH/2-150, HEIGHT/2-100, 75, 75)
sprite(button6, WIDTH/2-50, HEIGHT/2-100, 75, 75)
sprite(button7, WIDTH/2-250, HEIGHT/2-200, 75, 75)
sprite(button8, WIDTH/2-150, HEIGHT/2-200, 75, 75)
sprite(button9, WIDTH/2-50, HEIGHT/2-200, 75, 75)
-- This displays the "Right" and "Wrong" at the top of the screen
fill(255)
fontSize(48)
text("Right ",WIDTH/2-100,HEIGHT-50)
text("Wrong ",WIDTH/2+100,HEIGHT-50)
end