jeroencoessens

Members
  • Content Count

    2
  • Joined

  • Last visited

About jeroencoessens

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @samme I think that would work yes, I found a messy workaround for my specific situation which let me use my already existing arrays. For left and right checking I held 2 bools ( left and right ) in a forloop when checking the tiles, when both were true at the end of the forloop the tile would be locked, but only if they were on the same level: if(buttons[i].position.x <= buttons[card.index].position.x + tileWidth + offset && buttons[i].position.x >= buttons[card.index].position.x + tileWidth - offset) { if(buttons[i].visible) countRight = true; } It's messy because I'm not working with columns due to tile being able to get placed on halfway spots as well. This works though for the left and right checking but is not ideal. the reason I'm using an offset range is because my positions are not always that precise for some reason, don't know why.
  2. Hi, I'm making a tile based mahjong clone, you can check the attached image for reference. basically I need a smart way to implement the mechanic of mahjong, that checks when I tap a tile if he has neighbours ( left or right ) and if he has a tile ontop of him. The way these are placed makes it very difficult for me to come up with a system. The sprites/buttons are all overlapping already I have my buttons(tiles) in an array and the references to which tile it is in a seperate array so I can create them easily for more levels. Is there someone who can help me tell phaser to check this without giving each tile in each level a reference to neighbours ( would take forever ) If you want me paste some code just ask