attempt to preform arithmetic on field "xvel" (a nil value)
Posted: Mon Mar 10, 2014 12:41 am
I'm getting this error in my player.lua, inside my player.physics(dt), and I'm not really sure how to fix this with the error.
I've gotten this error before and I really don't know at all what to do about it.
.LOVE For the game is attached, thanks in advance.
Code: Select all
function player.physics(dt)
player.x = player.x + player.xvel * dt
player.y = player.y + player.yvel * dt
player.xvel = player.xvel * (1 - math.min(dt*friction, 1))
end
.LOVE For the game is attached, thanks in advance.