This site requires JavaScript, please enable it in your browser!
Greenfoot back
Kytuzian
Kytuzian wrote ...

2014/12/15

Input Locking Up

Kytuzian Kytuzian

2014/12/15

#
isKeyDown() seems to lock up and stop working after a little bit if I call it too much. Here is my code:
if (Greenfoot.isKeyDown("w"))
    y -= SPEED;
 if (Greenfoot.isKeyDown("s"))
    y += SPEED;
if (Greenfoot.isKeyDown("a"))
    x -= SPEED;
if (Greenfoot.isKeyDown("d"))
    x += SPEED;
           
setLocation((int)x, (int)y);
Any suggestions or ideas on how to fix this would be great.
danpost danpost

2014/12/16

#
Might have to see more code to figure this one out. What makes you believe that this is the problem code?
Kytuzian Kytuzian

2014/12/16

#
The issue seems to have resolved itself at this point, but I believe this is the problem because everything else was working except for the keyboard input.
You need to login to post a reply.