Please help, im trying something
Posted: Mon Nov 22, 2021 3:02 am
please help me, i've been trying to make the 'cash' variable go up and it wont budge, does anyone know how to fix this?
function love.load()
numberOne = 0
numberTwo = 0
numberThree = 0
cash = 0
timesSpun = 0
end
function love.update(dt)
if numberOne > 9 then
numberOne = 1
elseif numberTwo > 9 then
numberTwo = 1
elseif numberThree > 9 then
numberThree = 1
elseif numberOne == numberTwo == numberThree then
cash = cash + 1
end
end
function love.keypressed(key)
if key == "enter" then
timesSpun = timesSpun + 1
else
numberOne = numberOne + love.math.random(1, 10)
numberTwo = numberTwo + love.math.random(1, 10)
numberThree = numberThree + love.math.random(1, 10)
end
function love.draw()
love.graphics.print(cash, 10, 10)
love.graphics.print(numberOne, 200, 300)
love.graphics.print(numberTwo, 300, 300)
love.graphics.print(numberThree, 400, 300)
love.graphics.print("Press 'Enter' to Spin!", 400, 10)
end
end
function love.load()
numberOne = 0
numberTwo = 0
numberThree = 0
cash = 0
timesSpun = 0
end
function love.update(dt)
if numberOne > 9 then
numberOne = 1
elseif numberTwo > 9 then
numberTwo = 1
elseif numberThree > 9 then
numberThree = 1
elseif numberOne == numberTwo == numberThree then
cash = cash + 1
end
end
function love.keypressed(key)
if key == "enter" then
timesSpun = timesSpun + 1
else
numberOne = numberOne + love.math.random(1, 10)
numberTwo = numberTwo + love.math.random(1, 10)
numberThree = numberThree + love.math.random(1, 10)
end
function love.draw()
love.graphics.print(cash, 10, 10)
love.graphics.print(numberOne, 200, 300)
love.graphics.print(numberTwo, 300, 300)
love.graphics.print(numberThree, 400, 300)
love.graphics.print("Press 'Enter' to Spin!", 400, 10)
end
end