don't click here

Logistical question

Discussion in 'Technical Discussion' started by Travelsonic, Nov 30, 2011.

  1. Travelsonic

    Travelsonic

    Member
    827
    20
    18
    So I want to program a simple game in Java - nothing fancy - using everything I have learned this semester from classes & inheritance, to swing, to concurrency [threads, etc] to stuff I've been fiddling around with regarding the use of the BufferedImage class, and other graphical stuff. I was thinking about doing a simple breakout type game.

    The thing that I am having trouble wrapping my head around is the best means of structuring the code.

    Let me TRY to explain:

    During the game, we'd have:
    - checks for user input [move paddle left/right]
    - animations [brick animations, ball animation, bg animation?]
    - the ball movement
    - checking for ball collisions against the walls, paddle, other bricks, and the bottom of the chamber, triggering a game over
    - the movement of items dropping from select bricks
    - the collision between the paddle and those bricks
    - knowing when to trigger certain SFX, etc

    So 7 things going on concurrently.

    What is baffling me is trying to figure out the best means of structuring it so it is all one fluid set of acts - to check all these things - without the game being a sloppy, laggy mess that I'd throw my keyboard at. I mean, I know threading should be involved here, but I guess my trouble is how to create a thread manager for them all and figuring out the best means of doing that efficiently.