Hi

I’m still in the development of my 2D top-down game, and I’m getting to the point where I need to start considering my level design. I have my functional requirements mapped out as such:

Need-to-have:

1: Be able to detect collisions given moving elements that have a collision shaped defined by simple shapes (circle, square, triangle)

2. Be able to calculate an outgoing trajectory, considering an element hitting the walls with an in-going trajectory (much like snooker)

3. Be able to create levels algorithmically or textually (not necessarily procedurally). A scene could be considered if it makes sense given a set of tiles/some way to ‘draw the level’ (but much rather create the level in code)

4. Be able to define different properties for different sections of the ‘walls’ (ie. passable or other such functions)

Nice-to-have:

- Granularity that makes any out-going trajectory possible considering any in-going trajectory (ie. curved, smooth walls and jagged, spiky walls). Further explenation:
- Give walls different kinds of textures/tiling
- Define sections of the level by mathematical functions. Could perhaps make collisions detection easy - just insert coordinates into the function to check (not sure). Examples

The inspiration for my game is Subspace (old school game), and the level design is a big turning point here. However, one factor I want to improve in my game, is the granularity of the levels. In Subspace, There are 16 pixel blocks, with clever tiles that makes the walls appear diagonal (but they are not):

a. If I fire (non-perpendicularly) at a diagonal wall in Subspace, the inner angle of my bouncing shot will be 90 degrees or less (hope that makes sense). I would like it possible that it could be up to <180 degrees. Now, if I fire at a vertical or horisontal wall in Subspace, the inner angle can be <180 degrees as expected. I think it comes down to granularity, collision shape(s), collision detections and trajectory calculations. I’m looking for input on how to get started.

b. If I fire perpendicularly at a diagonal wall in subspace, my shot will come straight back (given that it can bounce twice) because it bounces of two blocks.

Hope that makes sense - I’ll update if I think of ways to solve them. I haven’t dabbled much in this area before, so will have to do some research.

Let me know if anything is unclear