Deck numbers

  • HI

    I use a Deck to place sprites

    4x4

    But how can I create a nummer for each box

    like

    1 2 3 4

    5 6 7 8

    9 10 11 12

    13 14 15 16

    Maybe put them into a global variable

    All Idears welcome :-)

  • Okay...

    How can I set a value each slot in deck that is 4x4

    so I can track the position of the sprites

    eg flower is in slot 6, bird is in slot 11 .....

    Cheers

  • If I understood you correctly, you'd want to save reference to a sprite in array? One way would be to save objects UID there, so you know which object is where.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ooohhh yes your right !!

    BUT how can this be done ..lets say that I push a sprie and want to know

    where its placed

    thanks for relpy

  • Use an array.

    Parse it via a function where you set the first parameter to the sprite you are looking for.

    function

    -For each X

    X = function.param(0): set localvariable to array.CurX

    function set returnvalue to localvariable

    after that access the position of the searched element via function.returnvalue

    if you have/expect duplicates, use an array again or save the numbers as string with separators and later on parse it out

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