Need help fixing bug- gem game column falls down

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • So I'm trying to make an example for someone else. He wants to make a gem game where you have gems that fall down when other gems are removed from the board. He told me he doesn't want to be creating or destroying any new gems on the board, he just wants to use the existing gems and change their animations to make it look like they're being moved around. He told me he already has an array with IDs and stuff set up so it would be easier this way for him.

    So his idea was to take a column, and shift all of the gems upwards by 1 tile, then "transfer" all the animations down a tile. Therefore there will be an empty space tile where the user just clicked and it looks like the tiles above weren't changed from before. This also allows a new tile to be at the top of the column that will fall down with the rest of the gems. Then the column would slide down to occupy the empty space.

    Now I did all of this with fastloops and it works great for the most part. However if I try to destroy another block in the same column as I did before, the system breaks. I'll link the .mfa and a GIF showing what's happening. Any help would be appreciated, I'm not sure why this is happening. I tried to organize and comment my code as best as I could to help people understand my thought process. Thanks!

    GIF: Please login to see this link.

    MFA: Please login to see this link.

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

  • Hey Sumo,

    that's a very nice idea and a clever template.

    While looking for the issue I've simplified the concept a bit more and the issue disappeared too,
    so not sure where the original problem was XD
    hope it's useful anyway:

    Please login to see this attachment.


    edit:
    re_reading your original question,
    this example doesn't take into account array shifting of values,
    but of course you can foreach items on the shifted column once the movement is started (or completed, depending on needs)
    to update the relevant array cells

    a selection of my Fusion examples can be found Please login to see this link.

  • Thanks for the example schrodinger. I was trying to avoid mixing the tiles up due to their ID values, but ill just foreach loop through them to fix them like you suggested. Your example definitely simplifies the process as well.

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!