Obviously it’s not finished yet, but I’ll keep working on it.
function setup()
displayMode(FULLSCREEN)
-- setting up the score and gameLost to be used later
score = 0
gameLost = false
-- setting up both coin and collector speed
rectSpeed = 3
coinSpeed = 2
-- setting up coordinates for movement arrows
upDownX = 150
leftRightY = 124
arrowWH = 75
-- setting up y coordinates for coins
coin1Y = math.random(0, HEIGHT-50)
coin2Y = math.random(0, HEIGHT-50)
coin3Y = math.random(0, HEIGHT-50)
coin4Y = math.random(0, HEIGHT-50)
coin5Y = math.random(0, HEIGHT-50)
-- setting up x coordinates for coins
coin1X = WIDTH
coin2X = coin1X + 150
coin3X = coin2X + 150
coin4X = coin3X + 150
coin5X = coin4X + 150
end
function draw()
-- setting the background color
background(255, 255, 255, 255)
-- creating the collector rectangle
pushStyle()
fill(255, 0, 0, 255)
rect(100, (HEIGHT/2 - 50), 100, 100)
popStyle()
-- creating the barrier
pushStyle()
fill(0, 0, 0, 255)
rect (WIDTH-400, 0, 100, HEIGHT+1)
popStyle()
-- creating the arrow sprites
sprite("Dropbox:arrow up", upDownX, 196, arrowWH, arrowWH)
sprite("Dropbox:arrow down", upDownX, 50, arrowWH, arrowWH)
sprite("Dropbox:arrow left", 75, leftRightY, arrowWH, arrowWH)
sprite("Dropbox:arrow right", 224, leftRightY, arrowWH, arrowWH)
end
function touched(touch)
end
At this point it doesn’t really do anything, but I’ll get it working soon. Any tips are appreciated.