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

2013/5/16

mouseClicked on object

vbh vbh

2013/5/16

#
i have a fish object i want to remove and then add a new one when i click whit the mouse, my problem rigt now is that it happens nomatter where i click in the world and not only when i click the fish public void newRandomFish() { if( Greenfoot.mouseClicked(null)) { World world = getWorld(); world.removeObject(this); world.addObject(new fisk1(),Greenfoot.getRandomNumber(300), Greenfoot.getRandomNumber(400)); } i think the problem is that i write null in mouseClicked, but im not sure what to write insted can u help thankyou
vbh vbh

2013/5/16

#
probleme solve :-) i wrote this, that did the trick :-)
You need to login to post a reply.