Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]How are levels designed?  (Read 2902 times)

0 Members and 1 Guest are viewing this topic.

mattr

  • Newbie
  • *
  • Posts: 13
    • View Profile
[SOLVED]How are levels designed?
« on: July 31, 2013, 09:50:20 pm »
I'm making a breakout game that will have several different levels, with different brick layouts in each one. I currently have a state machine that changes my main loop for each level (or state, to be more general). In each level I have a list of blocks that each have a position. It's pretty cumbersome to manualy define each position, and then push it into the list. How are things like this usually done? I can see this being especially hard with more complex types of games.
« Last Edit: July 31, 2013, 10:47:10 pm by mattr »

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: How are levels designed?
« Reply #1 on: July 31, 2013, 10:06:03 pm »
For something like that, some sort of level designer could be useful. Something that would let you "place" the bricks in your level and it would make the level file you use in the game.
DSFML - SFML for the D Programming Language.

mattr

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: How are levels designed?
« Reply #2 on: July 31, 2013, 10:08:02 pm »
Are there any particular ones that are good? Or is this something you have to make yourself?

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: How are levels designed?
« Reply #3 on: July 31, 2013, 10:30:25 pm »
It depends on if you're using something else to make your game(like an engine for example), but generally speaking they are custom made for the game itself.
DSFML - SFML for the D Programming Language.

mattr

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: How are levels designed?
« Reply #4 on: July 31, 2013, 10:46:55 pm »
Ok thanks a lot.

datMoka

  • Newbie
  • *
  • Posts: 48
  • Wooo!
    • View Profile
Re: [SOLVED]How are levels designed?
« Reply #5 on: August 01, 2013, 12:08:59 am »
If you don't get on with that method, look at trying to created a grid based system from your bricks (i.e 50x20 grid of available positions that bricks could go) then use a tile loader to load from a text file that could look like this:
Code: [Select]

1111001111
1111001111


and it will only place blocks down where the 1s are and leave the 0s blank on the grid.

You'd have to set up the grid manually with the co-ordinates of each grid space (either truly manually or using for loops) but once that's done you'll have a system which will allow you to easily create new levels with just putting 0s and 1s into a text file!

mattr

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [SOLVED]How are levels designed?
« Reply #6 on: August 01, 2013, 02:13:23 am »
If you don't get on with that method, look at trying to created a grid based system from your bricks (i.e 50x20 grid of available positions that bricks could go) then use a tile loader to load from a text file that could look like this:
Code: [Select]

1111001111
1111001111


and it will only place blocks down where the 1s are and leave the 0s blank on the grid.

You'd have to set up the grid manually with the co-ordinates of each grid space (either truly manually or using for loops) but once that's done you'll have a system which will allow you to easily create new levels with just putting 0s and 1s into a text file!

I was actually literally about to do this, but I was going to use x's and space's.

 

anything