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

2013/10/28

coding

hisham93 hisham93

2013/10/28

#
how to disappear animal when we click with mouse??what is it coding?
erdelf erdelf

2013/10/28

#
if(Greenfoot.mouseClicked(this))
getWorld().removeObject(this);
put this in the act method
hisham93 hisham93

2013/10/28

#
ok..how to ouput this in terminal window when animal are clicked?
erdelf erdelf

2013/10/28

#
if(Greenfoot.mouseClicked(this))
{
      getWorld().removeObject(this);
      System.out.println("removed animal");
}
hisham93 hisham93

2013/10/28

#
lastly a symbol smile will appear,,how to do it?
erdelf erdelf

2013/10/28

#
    if(Greenfoot.mouseClicked(this))  
    {  
          getWorld().getBackground().drawImage(new GreenfootImage("smile.jpg"),getX(),getY());
          getWorld().removeObject(this);  
          System.out.println("removed animal");  
    }  
You need to login to post a reply.