Attempt to perform arithmetic on global?
Posted: Thu Apr 03, 2014 12:04 am
Attempt to perform arithmetic on global. What does this mean?
Code: Select all
function love.load()
love.graphics.setBackgroundColor( 255, 255, 255 )
am2 = 100
am = 100
xam1 = 100
xam2 = 100
charecter = {400,550,100}
speed = 100
end
function love.draw()
love.graphics.setColor(255,0,0,255)
love.graphics.rectangle("fill",charecter[1],charecter[2],50,50)
end
function love.update(dt)
if love.keyboard.isDown("d") then
charecter[1] = charecter[1] + 500*dt
end
if love.keyboard.isDown("a") then
charecter[2] = charecter[1] - 500*dt
end
if love.keyboard.isDown(" ") then
charecter[2]=op
charecter[2]=charecter[2] - 100*dt
if charecter[2] == op+10 then
charecter[2] = charecter[2] + 100*dt
end
end
if love.keyboard.isDown(" ")then
pics()
end
end
function love.focus(bool)
end
function love.keypressed( key, unicode )
end
function love.keyreleased( key, unicode )
end
function love.mousepressed( x, y, button )
end
function love.mousereleased( x, y, button )
end
function love.quit()
end
function pics(dt)
--pics physics engine was made for the Rise Of The weak
if charecter[2]<550 then
print("Physics engine now running")
while charecter[2]<550 do
charecter[2] = charecter[2] + 300*dt
end
end
end
function movement(key,dt)
if key == "d" then
charecter[2] = charecter[1] + 500*dt
end
if key == "a" then
charecter[2] = charecter[1] - 500*dt
end
if key == "space" then
charecter[2]=op
charecter[2]=charecter[2] - 100*dt
if charecter[2] == op+10 then
charecter[2] = charecter[2] + 100*dt
end
end
endfunction love.load()
love.graphics.setBackgroundColor( 255, 255, 255 )
am2 = 100
am = 100
xam1 = 100
xam2 = 100
charecter = {400,550,100}
speed = 100
end
function love.draw()
love.graphics.setColor(255,0,0,255)
love.graphics.rectangle("fill",charecter[1],charecter[2],50,50)
end
function love.update(dt)
if love.keyboard.isDown("d") then
charecter[1] = charecter[1] + 500*dt
end
if love.keyboard.isDown("a") then
charecter[2] = charecter[1] - 500*dt
end
if love.keyboard.isDown(" ") then
charecter[2]=op
charecter[2]=charecter[2] - 100*dt
if charecter[2] == op+10 then
charecter[2] = charecter[2] + 100*dt
end
end
if love.keyboard.isDown(" ")then
pics()
end
end
function love.focus(bool)
end
function love.keypressed( key, unicode )
end
function love.keyreleased( key, unicode )
end
function love.mousepressed( x, y, button )
end
function love.mousereleased( x, y, button )
end
function love.quit()
end
function pics(dt)
--pics physics engine was made for the Rise Of The weak
if charecter[2]<550 then
print("Physics engine now running")
while charecter[2]<550 do
charecter[2] = charecter[2] + 300*dt
end
end
end
function movement(key,dt)
if key == "d" then
charecter[2] = charecter[1] + 500*dt
end
if key == "a" then
charecter[2] = charecter[1] - 500*dt
end
if key == "space" then
charecter[2]=op
charecter[2]=charecter[2] - 100*dt
if charecter[2] == op+10 then
charecter[2] = charecter[2] + 100*dt
end
end
end