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

2017/3/25

Rock Breaking

itslit itslit

2017/3/25

#
I have a main rock right now. When I have an object hit it, it breaks apart into multiple pieces (like its shattering), and I remove that main rock itself from the world. However, every time the object does hit the rock, I have it in a loop so it breaks each time. I'm trying to get it so that it breaks apart once, and so I can keep hitting the smaller pieces to remove it from the world. I'm stuck!
danpost danpost

2017/3/25

#
Use the size of the rock to determine whether to "shatter" or "remove" it. if width of image is greater than some value, shatter into pieces; else remove self
You need to login to post a reply.