Page 1 of 1

keypressed function won't call

Posted: Mon Jul 20, 2015 5:25 pm
by FOXmcloud021
I am new-ish to LOVE2D and I am working on a new project for the first time, however, I am having some problems with it. For some reason the keypressed function won't call whenever a key is pressed. I have tried to put print(key) within the function, but it does not print anything in the debug console. Here is my main.lua code: http://pastebin.com/FwAAc5Ry

Any possible way to fix? Thanks! :3

Re: keypressed function won't call

Posted: Mon Jul 20, 2015 6:30 pm
by airstruck
FOXmcloud021 wrote:the keypressed function won't call whenever a key is pressed
Are you sure? Try printing something out in the kepress function to see if it's really called.

From the code you've shown, ACanBeDown and SCanBeDown will never be true, so those conditions will always fail and nothing's going to appear to happen when you hit keys. Maybe you meant to initialize those to true instead of false?

Re: keypressed function won't call

Posted: Mon Jul 20, 2015 6:31 pm
by FOXmcloud021
I got it fixed
Sorry for the inconvenience!

:3