Page 1 of 1

pause key function

Posted: Thu Apr 05, 2012 11:59 am
by jimflim
Hi,
I have an issue with the keypressed function and would like to understand how exactly it works.
My problem is simple:
As the program takes a few milliseconds to calculate changes in the level, my player keeps on progressing as I hold a key down - which is an issue since I need to track his motion.
How can I pause or interrupt keyboard reading while updating the level?
I've used no coroutines or such in my prog, so that can't be it...
Thanks for your help,
jimflim

Re: pause key function

Posted: Thu Apr 05, 2012 12:13 pm
by Davidobot
jimflim wrote:Hi,
I have an issue with the keypressed function and would like to understand how exactly it works.
My problem is simple:
As the program takes a few milliseconds to calculate changes in the level, my player keeps on progressing as I hold a key down - which is an issue since I need to track his motion.
How can I pause or interrupt keyboard reading while updating the level?
I've used no coroutines or such in my prog, so that can't be it...
Thanks for your help,
jimflim
Can you please upload the .love so we can see what you mean? ;)

Re: pause key function

Posted: Thu Apr 05, 2012 12:19 pm
by jimflim
didn't want to cross-post, but here it is:

download/file.php?id=4321

when you close an area and keep a key down, you'll have a trace beginning in the middle - causing a crash -_-

Re: pause key function

Posted: Thu Apr 05, 2012 12:33 pm
by Davidobot
jimflim wrote:didn't want to cross-post, but here it is:

download/file.php?id=4321

when you close an area and keep a key down, you'll have a trace beginning in the middle - causing a crash -_-
I was able to reproduce the crash but looking through the code I can't seem to find the cause. :(