1 decade ago by squagmire
Having a random problem, can't quite figure out what is causing it. My game is a side-scrolling racer/platformer, and I've been trying to set it up as follows:
On the first detected player movement, a timer starts. From the time they begin moving, the player has 30 seconds to reach the end of each level, otherwise they "die".
I had this working just fine, but as soon as I wrapped everything in the director plugin (cutting and pasting most of the code from the YOSS game example main.js file), everything went haywire. Now, as long as I do not trigger the level timer, the game still works fine, but as soon as I turn it on, every input state seems to "stick", as in, once you press the Jump key, you just keep jumping until the timer runs out. It's obviously unplayable this way. I've moved the timer variable from main.js to player.js and tried various other fixes, but as I don't know what's going wrong in the first place, I don't even know what to try to fix...
On the first detected player movement, a timer starts. From the time they begin moving, the player has 30 seconds to reach the end of each level, otherwise they "die".
I had this working just fine, but as soon as I wrapped everything in the director plugin (cutting and pasting most of the code from the YOSS game example main.js file), everything went haywire. Now, as long as I do not trigger the level timer, the game still works fine, but as soon as I turn it on, every input state seems to "stick", as in, once you press the Jump key, you just keep jumping until the timer runs out. It's obviously unplayable this way. I've moved the timer variable from main.js to player.js and tried various other fixes, but as I don't know what's going wrong in the first place, I don't even know what to try to fix...