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

2013/5/18

Key Pressed

Gzuzfrk Gzuzfrk

2013/5/18

#
I'm so sorry I have so many questions but I have this code if(Greenfoot.isKeyDown("a")) { if(animationCount % .5 == 0) animateKick(); } and I want to make it to where it will go back to normal if the key is released. How do I do this?
Gevater_Tod4711 Gevater_Tod4711

2013/5/18

#
You have to add an else part after your if statement. If this else part is executed you set everything back to normal:
if(Greenfoot.isKeyDown("a")) {
    if(animationCount % .5 == 0) {
        animateKick(); 
    }
}
else {
    //Set everything back to normal;
} 
You need to login to post a reply.