Whenever I press the 'a' key on my keyboard to make my char go left, the first four frames will play and go left but after the four frame it will give out an error and exit,this only happened when I applied animations.
---------------------------------------------------------------------------------------------------------------------------------------
error:
includes/player.lua:line 83: Incorrect parameter type:expected userdata.
Traceback
[C]: in function 'draw'
here is the .love
http://www.mediafire.com/?9xwa9hr8185gmbf
help with "expected userdata"
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 37
- Joined: Fri Aug 02, 2013 1:44 pm
help with "expected userdata"
Sharing the one world
Also check out my friend's game!
http://love2d.org/forums/viewtopic.php?f=5&t=43276
Also check out my friend's game!
http://love2d.org/forums/viewtopic.php?f=5&t=43276
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: help with "expected userdata"
Easy fix: Use AnAL
-
- Prole
- Posts: 37
- Joined: Fri Aug 02, 2013 1:44 pm
Re: help with "expected userdata"
I don't want to re-code everything in my game just to add in the AnAl animation libraryRanguna259 wrote:Easy fix: Use AnAL
Sharing the one world
Also check out my friend's game!
http://love2d.org/forums/viewtopic.php?f=5&t=43276
Also check out my friend's game!
http://love2d.org/forums/viewtopic.php?f=5&t=43276
- DaedalusYoung
- Party member
- Posts: 407
- Joined: Sun Jul 14, 2013 8:04 pm
Re: help with "expected userdata"
Simple.
In includes/player.lua, on line 57 you increase player.pnum. But you forget to check if player.pnum surpasses 4. So, add the following lines after line 59:
In includes/player.lua, on line 57 you increase player.pnum. But you forget to check if player.pnum surpasses 4. So, add the following lines after line 59:
Code: Select all
if player.pnum > 4 then
player.pnum = 1
end
-
- Prole
- Posts: 37
- Joined: Fri Aug 02, 2013 1:44 pm
Re: help with "expected userdata"
thank you thank you thank you! I knew that the answer would be simple but I just kept over looking it!Simple.
In includes/player.lua, on line 57 you increase player.pnum. But you forget to check if player.pnum surpasses 4. So, add the following lines after line 59:
Sharing the one world
Also check out my friend's game!
http://love2d.org/forums/viewtopic.php?f=5&t=43276
Also check out my friend's game!
http://love2d.org/forums/viewtopic.php?f=5&t=43276
Who is online
Users browsing this forum: No registered users and 34 guests