sainsy's Forum Posts

  • Out of interest - what logic would you use to sort through a 2d grid of objects

  • Ah mate - that is fantastic - I need to pick this apart and see how it works, but this is exactly what I was working towards.

    Thanks lots n more

  • Not sure that would work - if i clear the array at any stage then i have lost the order of the cards and this array is the only place that exists - but thanks for the brainfart

  • Anybody? Please - I am going crazy

  • Could you use one sprite with 35 animation frames, then use the animation frame as the identifier - they could then be created in a loop. You could even pass the animation frame to the array.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have managed to get this far but am really struggling

    Card Rearranger CAPX

    The problem is not being able to manipulate one row in an array without changing the values in the rows below, so I have used two arrays - one to manipulate the order of the cards, the second to hold card positions, then use the Array index in the first to find the position in the second. Once new positions are established a function then moves all the cards to their new position.

    Works fine on the first move then it all goes horribly wrong.

    Please help - I am trying but this is my first attempt - it is driving me mad!!!!

  • OK - so what I am thinking is using an array when the cards are placed on the screen - 3 rows to the array - Y0 holds the animation frame of the card, Y1 holds the x position, Y2 holds the Y position.

    Is there a way of (on collision of 2 cards) only updating Y0 in the array without changing Y1 & Y2. I imagine that I need to delete the animation frame of the card being dropped, and then push it into the place where it is being dropped.

    E.g cards in order

    YO 0 1 2 3 4 5 6

    Drag card six and drop it on one

    Y0 0 6 1 2 3 4 5

    After the array is updated, I can then move all the cards to their new position in Y1 & Y2

  • Just a hobby - well, not even that - that is my one and only attempt at animation.

    We run a centre for Speech Therapy for people with Autism or Learning Disabilities - that is what the app is for

    Will keep you posted - if I can get a model working am sure it will be a lot of use to others

  • I have been developing a card sorting app (in a different thread) and wanted to try an alternative solution. I have done a fairly comprehensive trawl of the forums and tutorials, and can't find an obvious solution - hence starting a new thread.

    What I am trying to achieve is akin to the iPhone screen when you organise the apps - if you drag an icon, all of the other icons shift to accommodate the new position.

    Before I try and reinvent the wheel - has anyone tried to create something similar, or know of a plugin that would help with this.

    I have found examples where two items swap position on overlap, but would love to have the visual 'shuffle' effect. My initial thoughts are along the line of using an array and pushing values into it on the overlap event and pulling the surplus from the array - then using something like 'litetween' to animate the cards to their new position.

  • That's very cool - what a lovely present - something with thought and time makes a much nicer present I feel.

    I did this for my wife's 50th - youtube.com/watch

    Will have a go at picking it apart - I am sure there is lots there I can learn from - very elegant solution.

    I am also going to try using just pictures that can be manipulated - like on an iPhone when you move the apps around the screen - but will start a separate post for that.

    Thanks again for your help

  • Oooh - I like the first idea Dutoit

    So I would set up a number of columns of pics (so a four card deck would be four high by four wide) each column would be randomly shuffled.

    Any ideas on making the pictures 'slide' - would i use a plugin like 'litetween', or is there a simpler solution built in?

    Thanks so much all for your support and suggestions - it is a great help

  • Hi Dutoit

    There will be a number of 'little games' each with a different picture set - i was thinking I would just create a new layout and event sheet for each!

    There will be anything between 2 and 7 cards for each game, with each game having equal amounts of number cards

    Would definitely be interested in any suggestions, this is my first working prototype of many, many attempts

  • Many thanks Plinkie. Great idea - I will give that a go - I guess just set up a Boolean variable on each placeholder and set it to true if an object is placed on it.

    I used arrays because I tried using a simple IF statement to detect a match, but then couldn't easily reverse it when a card was then taken away or count up the score. I will have another look if it gets too messy.

  • Hi All

    Have been working on my first project - a game to place pictures in order - and have just about reached the end of my abilities. Have based some of this on the excellent 'Card Match' tutorial by Kitty (many thanks).

    The object of the game is fairly straightforward - you have a number of pictures and you have to place them in the correct order - in this case a boy shopping for a fish. It will be an educational game to teach 'sequencing' to people with learning disabilities.

    However, I am now struggling.

    Firstly, the scoring works fine if you place the pictures in the correct place. It then reverses the score if you take the picture away again. However, if you place a picture from one placeholder to another (say from 2 to 4) the score remains the same. Any ideas how i might solve this.

    Secondly, the 'snap to placeholder' action is a little off - even if the card is fractionally touching a placeholder to the right, it will snap there.

    Finally, if anybody has any recommendations on improving my methods then they would be gratefully received.

    CAPX here

    Many thanks in advance

    Brian