love.exe hungs up for some reason
Posted: Sat Nov 04, 2017 9:47 pm
I was just scripting a car that was meant to rotate left when left key is pressed, but for some reason, when I'm trying to execute it, it hang up on me and stops responding! Source code:
player={x=100,y=100,speed=150,img=nil,orientation=0,size=0.5,tlitvalue=(math.pi*2)/256,offsetx,offsety}
function love.load(arg)
player.img=love.graphics.newImage('assets/CarBlue.png')
player.offsetx=player.img:getWidth()/2
player.offsety=player.img:getHeight()/2
end
function love.update(dt)
while love.keyboard.isDown(left) do
player.orientation=(player.orientation-player.tlitvalue)*dt
end
end
function love.draw(dt)
love.graphics.draw(player.img, player.x, player.y, player.orientation, player.size, player.size, player.offsetx, player.offsety)
end
Help! Also, my first post, sorry if I made something dumb ;-)
player={x=100,y=100,speed=150,img=nil,orientation=0,size=0.5,tlitvalue=(math.pi*2)/256,offsetx,offsety}
function love.load(arg)
player.img=love.graphics.newImage('assets/CarBlue.png')
player.offsetx=player.img:getWidth()/2
player.offsety=player.img:getHeight()/2
end
function love.update(dt)
while love.keyboard.isDown(left) do
player.orientation=(player.orientation-player.tlitvalue)*dt
end
end
function love.draw(dt)
love.graphics.draw(player.img, player.x, player.y, player.orientation, player.size, player.size, player.offsetx, player.offsety)
end
Help! Also, my first post, sorry if I made something dumb ;-)