(Solved) How do I make cards placed like this?

0 favourites
  • 7 posts
From the Asset Store
Create your own trading card game with this Fantasy TCG Card Template
  • Ok so you know how in the card game yugioh when you play a card it goes to the middle and when you play another card it goes to the right of that card and when you play a third card it goes to the left of that card of the first card you played. Then when you play a fourth card it goes to the right of the second card you played and lastly you play the fifth card and it goes to the left of the third card you played. How do you go about doing this? I kinda have it down a bit but I'm worried when a card is destroyed will the next card I play go to the spot of the destroyed card 🤔 lol Any ideas would be greatly appreciated! Thanks

  • Oh and here's a good video of what I'm looking for.

    https://youtu.be/Z9NTPj4W6RI

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Which part of the video are you referring to?

    Also, what do you mean by "when you play a card" - is this when you remove a card from your hand and place in onto the table?

    Or is this when you receive a card from the deck and it's added to your hand?

    I'm struggling to understand how is this question different from your previous post?

  • Which part of the video are you referring to?

    Also, what do you mean by "when you play a card" - is this when you remove a card from your hand and place in onto the table?

    Or is this when you receive a card from the deck and it's added to your hand?

    I'm struggling to understand how is this question different from your previous post?

    Sorry about that... yeah it's the part removing card from hand and palce it onto the table. Doing one is easy but then comes when i want to play another card. I don't want it to go on top of the first card on the table. I want to play up to 5 cards on the table but not have the cards slide over like the hand of cards. if you see in the video that cards get placed and the table next to each other without having to slide them over

  • The easiest way is to define 5 imagepoints on the table sprite. And then simply place cards on these imagepoints.

    Card #1 goes to "CardPoint1", card #2 goes to "CardPoint2" and so on.

    Card set position to (Table.ImagePointX("CardPoint" & cardNumber) , Table.ImagePointY("CardPoint" & cardNumber))

  • The easiest way is to define 5 imagepoints on the table sprite. And then simply place cards on these imagepoints.

    Card #1 goes to "CardPoint1", card #2 goes to "CardPoint2" and so on.

    Card set position to (Table.ImagePointX("CardPoint" & cardNumber) , Table.ImagePointY("CardPoint" & cardNumber))

    I was able to fix the set up that I made, thanks!

  • Also, if you have a variable undetermined number of cards, you might have an array for the table and push the card used to its front or back.

    Every hand you would do something like this:

    tableCards array set size to 0,1,1
    
    on card clicked
        if tableCards.Width % 2 = 0 | tableCards push cardId on FRONT
        else                         | tableCards push cardId on BACK
    
    redraw table
    [/code:1cvd5i72]
    
    Hope this helps. Cheers!
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)