How can I exchange positions between objects?

0 favourites
  • 7 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • How can I exchange positions between cards?

    of the same object... that is, the card is divided into 3 but it is the same object

    giphy.com/embed/4HFn4weFzX9LGZRlhM

    I was watching some tutorials but it didn't work for me

    I hope you can help me

    Tagged:

  • im not really sure what you exactly want but this is one way of acheiving something similiar to selecting a card and selecting another card to switch

    Solution:

    click a card and save its uid,x & positions,then click on another card that you want to switch.

    create a array that holds x and y positions ,then on mouse release set the position of the clicked card to the saved coordinates[0].Once that is done,pick a card with the saved uid and then set its position to the saved coordinates[array.count-1]

  • I need to do this....

    giphy.com/embed/FEXuit4o4Miu4oQlV5

    but my event is the following

    The system creates the cards according to the number of spaces,,,

    Could you explain the event to me step by step....should I use the UID of the created card?

  • Well you can do what i said before but add a tween to the cards that slowly drags the card to the new position.

    for the switching i am not sure how to as i have never done anything similair to it,but maybe check the spaces[overlapp] for wheter they have a card or not,If they do and a card is selected you can try to switch them using the method mentioned before.

    ps.Make the spaces save the card uid that is on top of them that will be helpful with switching positions

  • I'm more lost than a penguin in the desert

    something like that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • give your card a variable called "SpaceUid", in it you store the uid of the space it will overlapp.Once that is done make it so that when the card overlapps another card it switches its uid from "".beneath that event make a foreach card condition in which each card picks a space using the stored uid and then sets its position to that space.

    I am not sure how to switch 2 variables with eachoter but i am pretty sure that there is a way to do that using arrays or dictionary or other ways of storing.

    Maybe you can have each card have a "PastSpaceuid" variable that saves the past uid...

    ps.if you have a problem after this send the link to your c3 file so that i can help you make the feature,but also explain exactly what your game is about so that i can make a feature that fits what you want.

  • What I need is to do this with the cards once they are in the yellow spaces

    giphy.com/embed/FEXuit4o4Miu4oQlV5

    I need to drag a card and change its position with another as in the gif image

    here is the c3 file

    drive.google.com/file/d/1CTaK1DjQOvLcma1fNc2ddXDc_Ufmtlki/view

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