Skip to main content
GameDev.net gamedev.net
🔒 Locked

Block falling algorithm....

Started by Dark Star Aug 29, 2003 at 4:04 PM 0 replies 800+ views
Original Post
Dark Star
Dark Star
Hi all, been playing mr driller lately to study for a project, Im making a remake of it soon I was puzzled by how they make the blocks fall when the level is being re-adjusted, by that I mean when a block below ceases to exist, how do they make the others fall? I know how Id do it, but I dont get how they do it when u got connected blocks. To see what I mean check out the illustration below:

    1
    2345
      6
    X
 
say the numbers one to six are the coloured blocks (all with same colour and connected to each other) and X is another colour block. all the coloured blocks (the same number) should fall until block 2 sits on top of block X. like so


    1
    2345
    x 6

Mr Driller does this and I got no idea how I would design an algorithm to do this....blocks 3,4,5,6 and 1 dont fall all because they are connected to block 2 that is sitting on a block (x) which cannot fall. Thanks for your help Dark Star UK
---------------------------------------------You Only Live Once - Don't be afriad to take chances.
Waverider
Waverider
Each block could have a unique identifier stating which compound object it is a part of. That way, when a block ceases to exist, allowing the blocks above to fall, you would check ALL blocks with that same identifier to see if all of them can fall before you allow the entire object to drop.
It's not what you're taught, it's what you learn.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.