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

2019/10/24

isKeyDown only detect once

WackBoi WackBoi

2019/10/24

#
Can I do it so when I press a key some sample code gets run only once and I need to press it again for it to run again. Because "isKeyDown" detects it always and runs the code multiple times. Check out my sick code:
if(a.size() > 0 && Greenfoot.isKeyDown(a.get(0).Taste))
        {      
            getWorld().removeObject(a.get(0));
            a.remove(0);
        } 
@greenfoot you might want to fix your captchas to signup. Took me 3 days to sign up.
danpost danpost

2019/10/24

#
See this discussion thread.
WackBoi WackBoi

2019/10/25

#
That was exactly what I was looking for. Thanks for your efforts. Appreciate it a lot.
You need to login to post a reply.