Drop grid effect - need assistance

Hello all,

Here is what I am trying to achieve:

Remember that drop grid demo from GShelper a while back. While spending a few hours on it, it's not the right coding I am looking for. When an actor is pressed, actors up from it need to fall down to fill in the gap, and that actor than goes to the top of the line. Sort of like a bejewelled type thing but just trying to get the fall down effect.


Here is what I have done:

No point in asking a question if I haven't tried. I have six actors, each with an ID of 50,55,60 ect up to 70. As well as a table with 70 cells.
They all change thier cell ID to one, that means that they are in position. When one is touched, it changes its current cell ID to 0. Then changes position to top (have no idea how to do this if two actors are touched, since it means they no in same position) and change its ID to self.ID minus 35.

They also have a rule where if the actor below them (table cell self.ID plus 6) is equal to zero, than move to self position minus 120. (120 is the size of the actors)

This works fine for one or two different dots but its very messy and some of the other dots don't move or get stuck.

Any ideas, or any other demos besides that I mentioned that could have bits to learn from?

Thanks

Best Answer

  • grimtoothgrimtooth Posts: 69
    Accepted Answer
    I guess I don't know "exactly" what you are trying to do but if you never need to move a block DOWN the stack, I would think gravity and collision would be easier than anything?

    Lock rotation, bounciness=0, accelerate@270 (scene)

    can't use movement through solid actors or you'll get a fun block explosion (lol) so use change attribute self.y (position it above the top block, not in the same spot, and it will fall into position with the rest of the row)

    ??

    -Grim-


Answers

  • Bad wolf GuyBad wolf Guy Member Posts: 206
    @grimtooth thanks for the reply.
    Unfortunately that only a works in theory, GS has a few issues with detecting collision ect, I read many threads and spent many nights experimenting with gravity but never came to a workable solution that could be repeated without fault. But if I am wrong than I would be happy to have another look.

    But once I got fimilar with table I seem to want to use them in eveything for everything. It also gives me more control down the line. But that's why I didn't go with the gravity. Once again if I am wrong about it and it actually does work than I am all ears.

    Thanks
  • Bad wolf GuyBad wolf Guy Member Posts: 206
    Thanks, all good now. Nothing a few hours experimenting couldn't fix.
Sign In or Register to comment.