Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
Omnikariz
- Prole
- Posts: 2
- Joined: Wed Jan 29, 2014 5:15 am
Post
by Omnikariz »
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.
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
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.
-
Attachments
-
- alot.love
- The .LOVE for the game
- (924 Bytes) Downloaded 149 times
-
micha
- Inner party member
- Posts: 1083
- Joined: Wed Sep 26, 2012 5:13 pm
Post
by micha »
This error means that the variable player.xvel does not exist at the time when the corresponding line is executed. Add
to you love.load and the error is gone (you will get a different error then, because friction is not defined).
-
Omnikariz
- Prole
- Posts: 2
- Joined: Wed Jan 29, 2014 5:15 am
Post
by Omnikariz »
Yeah, thanks, shortly after posting this I found out the problems. Thanks anyway though.
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests