playMaker

Author Topic: A Pirate Story  (Read 1317 times)

LuminRabbit

  • Full Member
  • ***
  • Posts: 161
  • Lumin Rabbit
A Pirate Story
« on: July 01, 2020, 06:25:49 PM »
I hope everyone is having a great day so far!

I stumbled across a pretty cool game and I'm curious about the card movement mechanics, mainly when the player moves to a new location the other cards follow the player any ideas on how this was achieved (do you think it was a Grid Layout Group, etc..)

Here is a video to help illustrate:


All thoughts and ideas welcome, Thanks in advance!
Have I said how much I love playmaker!!! This is one amazing tool

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: A Pirate Story
« Reply #1 on: July 02, 2020, 02:03:48 AM »
Hi,

 it was unlikely a grid layout, at least not the built in one, it's too weak to setup properly for all possible screen ratios.

you can create your custom grid using anchoring, and you creat simple panels each positionned using relative anchors.

the key here is to understand that there are layers, the grid is not where the content is parented, the grid only acts as a reference to move a higher panel that simply matches the target grid to move to. you matches the rectransform values.

then once you have a system that can do that, each grid has a reference of some sort using X|Y indexes, so for example 0|0 would be the top left, and 3|3 the bottom right. then you can have a logic that lets you move a card from 2|3 to 1|3 which would go from the center cell  to the middle top cell.

you then add another feature that makes a particular card follow a target card where ever it goes. You could record the last cell indexes of the target card, this would be the cell to go to for the following card.

Bye,

 Jean

LuminRabbit

  • Full Member
  • ***
  • Posts: 161
  • Lumin Rabbit
Re: A Pirate Story
« Reply #2 on: July 02, 2020, 08:35:19 AM »
Hi Jean,

Thank you very much for the detailed response! I'm going to start researching and if I can figure it out will post the solution here ;)

Sincerely,
Michael
Have I said how much I love playmaker!!! This is one amazing tool