Changing number varibles
Posted: Sat Feb 23, 2013 8:45 pm
im tring to change a number varible everytime my timer reaches over 10 seconds but the quardinates dont change.
please help
Code: Select all
player = {}
player.x = 200
player.y = 300
player.speed = 150
player.width = 80
player.height = 80
player.friction = 0
QposX = 153
QposY = 33
fx = 240
fy = 320
timer = 2
one = 1
function player_load()
player.pic = love.graphics.newImage("Pics/sprsh.png")
quad = love.graphics.newQuad(3,3,112,112,468,124)
Face = love.graphics.newQuad(QposX,QposY, 74, 74, 468, 124)
end
function player_draw()
love.graphics.drawq(player.pic, quad, player.x, player.y)
love.graphics.drawq(player.pic, Face, fx, fy)
end
function player_active(dt)
if timer > 1 then
end
if love.keyboard.isDown("a") then
timer = timer + one * dt
QposX = 267
player.x = player.x - player.speed * dt
fx = fx - player.speed * dt
elseif love.keyboard.isDown("d") then
player.x = player.x + player.speed * dt
fx = fx + player.speed * dt
end
end
please help