Likely yes. unless this is a very slow paced game (turn based or puzzle variety) I think you are likely to find that Swing will give you neither the performance nor the control to do things like
animate smoothly.
Actually, it is a turn-based game.
I just got
Developing Games in Java by David Brackeen. Very good book so far, with many reusable code examples. One such piece of code is for a simple game loop. However, it seems that what is provided in the book is geared for games that are constantly being re-drawn, such as platform games. So should I still implement an animation loop in my turn-based game? If I don't use one, is there a way to draw, say, a static background image only once?
Also, I'm switching from making my game a windowed application to making it a fullscreen one. I read in DGJ about how you shouldn't have Swing components paint themselves in fullscreen mode. Does this only apply to constantly-animated games like platform games, or does it apply to turn-based games too?
Yep. Typically game developers either draw a background, and button art they BLT ontop of it or they draw two complete images, one with buttons up and one with them down. They then BLt pieces of the buttons down one over the buttons up one as necessary.
Right. I'm thinking of either doing that or continuing to use JButtons but with custom images for them. What do you think?
I'd need to see the code, My guess is that you are managing to use a peice of video memory that still contains data from the previous image and hasn't been over-written.
Are you clearing that panel or whatever the screen is?
I got that fixed, actually. Yeah, I think what you described was the problem. Thanks!
- Rob