wait i was thinking,.. how to make clicking movement? like i am making a piano game in which when you click run and click on the keys, they make a sound. but the the thing is, what is the code for clicking ??
//in the Key class
public void act()
{
if (Greenfoot.mousePressed(this))
{
//play some sound
}
}//Alternatively, in your world
private Key key = new Key();
//...
addObject(key, 50, 50);
//...
public void act()
{
if (Greenfoot.mousePressed(key))
{
//play some sound
}
}//in the Key class
public void act()
{
if (Greenfoot.mousePressed(this))
{
//play some sound
}
}//Alternatively, in your world
private Key key = new Key();
//...
addObject(key, 50, 50);
//...
public void act()
{
if (Greenfoot.mousePressed(key))
{
//play some sound
}
}//in the Key class
public void act()
{
if (Greenfoot.mousePressed(this))
{
//play some sound
}
}//Alternatively, in your world
private Key key = new Key();
//...
addObject(key, 50, 50);
//...
public void act()
{
if (Greenfoot.mousePressed(key))
{
//play some sound
}
}