It's my first time doing Java GUI stuff, and I have a few questions. I'm making a simple side-scrolling game - planning it out, specifically. The window is going to be 800x800.
There's going to be buildings drawn as the game scrolls (every 40 px or so). I'm thinking that I'll make one 900px black rectangle, and then set copies of it at different pixel-heights (to vary the heights of the new buildings). Then the bottom part of the rectangle would automatically be clipped.
(1) Would that work?
In the sky above the roofs, I'm going to have targets fly by that can be clicked on and shot down for points. I was thinking I'd make an ImageIcon of the target and then draw it moving across the screen. But I think it'd be hard to have to track the target coordinates and then get a mouse click coordinates and then check if they match.
(2) Is there any easy way to tell if the target is hit with a click (without a lot of coordinates and math)?
There's also skateboarder skating on top of the roofs from left to right. I was thinking I'd put a hidden rectangle behind him and then see if it intersects with a given rectangle roof to tell when he lands. But the problem is that they won't intersect until he's INSIDE the roof. And I want him to be right above the roof.
How can I find out when the skateboarder is just above the roof (without tons of coordinate math)?