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

2015/1/31

How to make a Block disappear when I click on it.

Jellyfish Jellyfish

2015/1/31

#
Hi I'm trying to create a mining game and I want to make it so that if you click on a block, it disappears! Thanks!
danpost danpost

2015/1/31

#
Jellyfish wrote...
Hi I'm trying to create a mining game and I want to make it so that if you click on a block, it disappears! Thanks!
What do you think you need to do? What have you tried? What methods do you think you will need? What class and method do you think it should be coded in?
Jellyfish Jellyfish

2015/1/31

#
I've figured it out, I think I just need to do getWorld.removeObject(this); in the if (Greenfoot.mouseClicked(this)) command
Jellyfish Jellyfish

2015/1/31

#
It works!
Jellyfish Jellyfish

2015/1/31

#
I had to do getWorld().removeObject(this); and it works!
danpost danpost

2015/1/31

#
Jellyfish wrote...
I've figured it out, I think I just need to do getWorld.removeObject(this); in the if (Greenfoot.mouseClicked(this)) command
That is one possible code (if placed properly).
danpost danpost

2015/1/31

#
Jellyfish wrote...
I had to do getWorld().removeObject(this); and it works!
good job.
You need to login to post a reply.