seeking for help on basic lua runtime error
CodeAttempt to perform Arithmetic on Global 'my_variable'
Code: Select all
function createLandObject()
love.graphics.print("distance " .. vecX, vecX, 10)
temp = temp + 1
temp = vecX
if temp >= 300 then
temp2 = temp
love.graphics.print("create object " .. vecX, vecX, 20)
table.insert(balls, 1, {x = temp2, y = y})
love.graphics.draw(arrow, temp2, y)
temp = 0
end
end
Code: Select all
function createLandObject()
love.graphics.print("distance " .. vecX, vecX, 10)
--temp = temp + 1
temp = vecX
if temp >= 300 then
temp2 = temp
love.graphics.print("create object " .. vecX, vecX, 20)
table.insert(balls, 1, {x = temp2, y = y})
love.graphics.draw(arrow, temp2, y)
temp = 0
end
end
- what so different between an assignment and operation (+-*/)
- how to resolve this if i need "temp" to be increase by 1 for every call
Thanks for the help