I'm making an application where buttons are either toggled on or off. (Boolean available) I want to use multiple inputs to reset the status of the buttons to available=false. However, the buttons do not change status with this code except for the spacebar one. Is there different syntax I need to use to get Greenfoot.isKeyDown() to work with these numbers. It's actually not working for basic inputs like "w","a","s", and "d" either. Any help would be greatly appreciated.
public Button(String day,int time)
{
}
public void act()
{
if (Greenfoot.mouseClicked(this))
{
available=true;
}
if(available)
{
setImage("buttonTrue.png");
}
if(Greenfoot.isKeyDown("space"))
{
available=false;
}
if(Greenfoot.isKeyDown("Q"))
{
available=false;
}
if(Greenfoot.isKeyDown("2"))
{
available=false;
}
if(Greenfoot.isKeyDown("three"))
{
available=false;
}
if(Greenfoot.isKeyDown("Four"))
{
available=false;
}
}
