It looks like you're new here. If you want to get involved, click one of these buttons!
I'm working on a simple game as I learn Codea. I'm placing a random number of sprites on the screen. When a sprite is touched, I want it to disappear. I'm looking for a simple way to detect if a sprite is touched. Currently, it looks like I need to write a lot of conditional code. Is there and easy way to handle this in Codea?
Comments
Create a class for the sprites with its own touched method that checks the bounding box of the sprite. The bounding box can be determined by the size of the sprite. For example this code drags a vehicle when touched:
Doffer,
Thanks for the reply. Very helpful. Got my code working now thanks to your help.
Can I use this? Will give credit!
@DJMoffinz Heres a version if you don’t want to use a class. Use this for whatever you want.
Thanks!