Jump to content
  • Advertisement
Sign in to follow this  
Huy Luu

BricksBreaker-style level design Question

This topic is 1423 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

 

I just want to drop by and ask a really simple question here. For a Bricks Breaker-style game, such as this one:

 

https://play.google.com/store/apps/details?id=com.wegoi.brickfree&hl=en

 

,the game automatically generates new levels everytime the player enters a new session. However, I wonder what methods/techniques did the designer use to assemble blocks so that when it is needed, a new level can be generated with both logic (Bricks count) and aesthetic (Block Shape, Symmetry).

 

If you have any ideas on this problem, please share your knowledge. That will really help me in a lot of ways. Thank you very much in advance !

Share this post


Link to post
Share on other sites
Advertisement

For this kind of thing, my method of doing it is to use a recursive random generator function.  So you'd have a function like generateRandom(x,y,w,h), where the parameters describe a rectangle.  generateRandom calls a random one of a few dozen generate functions with the same parameters, that do something to that rectangle, then call generateRandom again on one or more subrectangles of it.

 

For example, generateBorder(x,y,w,h) would fill in all the perimeter blocks, then call generateRandom(x+1,y+1,w-2,h-2) -- that is, draw a border and start again on the space inside that border.  generateVerticalSplit might fill a line down the middle and the call generateRandom twice, once for each of the regions delimited.  For vertical symmetry, you could have generateMirroredVerticalSplit, which only calls generateRandom for the left region, then mirrors it in the other region.

 

If you're comfortable with a functional style of programming, this is fun to do as a library of function combinators.

Edited by valrus

Share this post


Link to post
Share on other sites

Hello valrus,

 

I'm really thankful for your reply. Even though it might have a lot of stuff on the technical side, fortunately your explanation was simple enough for me to understand. I'm trying to implement the ruleset based on what you've guided here, and will tell you later if there's any problems occurred. So far so good, thank you very much friend !

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!