This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Game Development and the fly likes Building new game, Java 2D question about objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Building new game, Java 2D question about objects "diappearing"" Watch "Building new game, Java 2D question about objects "diappearing"" New topic
Author

Building new game, Java 2D question about objects "diappearing"

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

What is the most efficient way to have 2D objects "disappear"?
Here is an example:
If block1 is hit, block1hitmarker = true.
Later in code:

Or is there a better way to do this?
Thanks,
cc11rocks


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4094
    
  18

Simply don't draw them. What you are doing seems correct, except for some minor issues I have addressed in your other topic.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Building new game, Java 2D question about objects "diappearing"
 
It's not a secret anymore!