Help drawing two PImages - one that follows mouse and one that persists after a mouse press.
in
Programming Questions
•
1 year ago
So I'm learning processing with a group that are all novice programmers for the most part (we're excited about using processing for data visualization / statistical graphics).
We're just learning about dynamic programs, and one of us had the idea to make a crude "game" that simulates nuclear war (in a silly way).
The idea is that one image (a missile) will follow the mouse and when the mouse is clicked an image of an explosion will appear. We want the explosion images to last after the mouse click.
We've figured out how to get the explosion images to persist (but that requires us to not have the missile image). If we have both, it seems like when the draw function refreshes the missile image based on the new mouse position, it "writes over" the explosion. The code and the images are below - thanks for helping some newbs!
1