How can I pick the instance variable of a specific family element?

0 favourites
  • 2 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hi from Italy.

    Yup, it means my written english is a disaster.

    I'm trying to make a square-enix's Go-like game.

    This is my solution for the movement logic (you can -- no, you must -- suggest me another one, if it's better).

    I create different type of "tiles".

    Every tile has 4 boolean instance variables, to indicate if they have liberties of movement in the four directions or not.

    When the player is on a tile and press a direction key, the system contols:

    - the liberties of movement of the starting tile

    - the liberties of movemente of the destination tile

    Example: I press Up. Can I move?

    If the starting tile has the Up liberty on True and the destination tile the Down liberty on True, then yes: i can move.

    Else, i cannot.

    Simple, right? Wrong!

    I put all my tiles into a family.

    Now, when I press a direction button, I can pick the starting and destination tile from the family... but I can't pick their instance variables!

    Any idea? Please, help me. :)

    (I hope this will be understandable.)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would've done it a bit differently, just had one tile object where you change its type based on another instance variable. I'm not sure what your logic is for picking the starting (assumed player overlapping) and destination tiles, so cannot really see the problem.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)