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

2023/1/18

Remove an Object when actor touches another object

beaverboii beaverboii

2023/1/18

#
I want to remove a block when the main actor touches another block to open up a secret gateway in my game. Been trying to figure out how to do this for 4 class periods but my teacher and I don't know how to do it and the 15 yr old tutorials on YouTube don't help.
danpost danpost

2023/1/18

#
beaverboii wrote...
I want to remove a block when the main actor touches another block to open up a secret gateway in my game. Been trying to figure out how to do this for 4 class periods but my teacher and I don't know how to do it and the 15 yr old tutorials on YouTube don't help.
Best would probably be to have an Actor reference field in the Block class (or a special subclass of Block) to hold the Block object that special Block object is to remove. That way, when touched, it will know which one to remove.
You need to login to post a reply.