This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 3361
    
    9
Simply don't draw them. What you are doing seems correct, except for some minor issues I have addressed in your other topic.
 
wood burning stoves
 
subject: Building new game, Java 2D question about objects "diappearing"
 
Similar Threads
Graphics2D window not being repaired?
How does this code work
drawImage how to control scale quality
A flatland puzzle
Nothing seems to be moving?