We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, guys. I want to remove object when some condition is completed.
For example, the rectangle moves to any direction for each second. And when the rectangle meets the border line, the rectangle should be removed.
For now, I overdrew background-colored-object on the object. But, if I do this way, the memory would be gained, so the program would be heavy.
So, I'm looking forward about removing the objects. But even I googled the method, there wasn't any method about the above.
If anyone has good idea, please give it to me. Thanks for reading. :)
Answers
I can't grasp what you're asking for! Do you wanna know how to remove an object from a Collection
or how to write a method to determine whether an object gotta be removed/disabled? :-?
Perhaps these posts below got further tips about it:
http://forum.processing.org/two/discussion/2435/help-with-collision-detecting-of-2-arrays
http://forum.processing.org/two/discussion/2932/indexoutofboundsexception-while-iterating-through-and-removing-items-from-arraylists
Method 1: if you are not using ArrayList();
Method 2:If you are using ArrayList();
lunaria, we need more information, preferably the code.
without that we are guessing, wasting our time and yours.
Base method to remove an object from display: stop displaying it! If you use background() in draw(), as you should, it will be automatically erased.
Philho the problem is, how do you stop displaying it?
2014...