keypressed function won't call

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.
Post Reply
FOXmcloud021
Prole
Posts: 2
Joined: Mon Jul 20, 2015 5:19 pm

keypressed function won't call

Post 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
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: keypressed function won't call

Post 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?
Last edited by airstruck on Mon Jul 20, 2015 6:32 pm, edited 1 time in total.
FOXmcloud021
Prole
Posts: 2
Joined: Mon Jul 20, 2015 5:19 pm

Re: keypressed function won't call

Post by FOXmcloud021 »

I got it fixed
Sorry for the inconvenience!

:3
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests