Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: shade@dragonshadow.com (Scott Cartier) Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Bored? No! Why not have a go at this anyway.... Date: Tue, 22 Jun 1999 16:42:51 GMT Organization: SCEA News Server Lines: 34 Message-ID: <376fb87c.250214483@news.scea.sony.com> References: <7ko056$33u24@chuka.playstation.co.uk> NNTP-Posting-Host: vmlabs98.vmlabs.com X-Newsreader: Forte Free Agent 1.11/32.235 I can tell you how I have the levels in my game coded. Maybe that'll be of some use. I use two separate arrays for the levels. Each level has an entry in each of the two arrays. They are arranged sequentially so the fifth level corresponds to the fifth element in both arrays (that's a good movie btw). The first array dictates the layout of the levels. I have a branching structure so I needed some way to tell what levels lead to what. This array is also where I tell what the time limit for the level is as well as how fast the player has to complete it to get the time bonus. The second array stores the level objects themselves. Each object has a TYPE, SUBTYPE, SUBTYPE2, SCALE, X, and Y components. Naturally, not all object types need every one of those components. Enemies for example don't need a SCALE since they don't change size. In that case I can reuse the SCALE parameter to be hold whatever information I want. For enemy turrets I use it to store the angle they face at the beginning of the level. For your game I would probably separate out the background information from the enemy/powerup locations. For one thing, since the background info will probably be a huge structure, it would make dealing with the enemy info much easier. However, if the enemies are tightly coupled with the background that would make things a bit more difficult. As for collision detection, I would make that its own function (or set of functions). Make it general enough to handle anything. That way when you get to cranking out hundreds of levels (heh) you don't need to worry about getting the collision correct for each one. Your general function will handle them all. Scott