dcsimg
Pretty basic game design logics
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, December 10, 2004 02:50 PM

I am currently developing a rather simple game, an Asteroids type space shooter. I am making quite rapid progress, learning tons of new stuff all the time, but since I lack earlier experience I can't help still feeling very confused about the entire structure of the game. The structure is as follows: A main class which is supposed to control (start and stop in turn) the phases of the game, like unloading menu and loading game upon start, and vice versa when you quit, and so on. Since I'm not sure how to actually do this, I've set this class to init and start the game panel class at once. This class receives KeyEvents and WindowEvents, which it then sends to the active class for processing. The game class mainly    More>>

I am currently developing a rather simple game, an Asteroids type space shooter. I am making quite rapid progress, learning tons of new stuff all the time, but since I lack earlier experience I can't help still feeling very confused about the entire structure of the game.



The structure is as follows: A main class which is supposed to control (start and stop in turn) the phases of the game, like unloading menu and loading game upon start, and vice versa when you quit, and so on. Since I'm not sure how to actually do this, I've set this class to init and start the game panel class at once.
This class receives KeyEvents and WindowEvents, which it then sends to the active class for processing.



The game class mainly consists of a standard update-render-paint loop in run(), quite a lot of static variables, and processing of KeyEvents.



I then have a class each for backgound graphics (scrolling), ship, weapons array, and asteroids. These have their own update and render methods, and some variables and other stuff. The asteroid and weapons manager have arrays of AsteroidData and BulletData classes, and ways of creating these.



OK, and now the actual problem / question ... I haven't made it very far yet, but will probably be going to need tons of interaction between these classes rather soon. Just basic collision detection between bullets and asteroids required (?) a loop in the game loop accessing all AsteroidData[] and sending them to the weapons class, where each of them where compared to everything in the bullet array. Also, the minimap drawn in the "space background stuff class" uses the position of all objects to draw dots, why I have to collect a lot of data in the game class and send it to my space object each loop. This is getting rather frustrating, as I would prefer to keep my main game class as clean as possible. Also, I am planning to add a wide variety of possibilities, like different sorts of asteroids, enemies, guns, gravity and so on, and I'm thinking that it'll be a hell loading, keeping and using all these variables with the current structure.



So, I know it's quite a long post and pehaps detailed request, but could anyone please teach me the basics of this kind of stuff? Anything that increases my understanding and "sense" would be greatly appreciated!

   <<Less

Re: Pretty basic game design logics

Posted By:   Simon_Ablett  
Posted On:   Monday, December 13, 2004 05:24 AM

Have a look at 'Developing Games in Java' by David Brackeen and published by New Riders.

Regards.
About | Sitemap | Contact