Hello everyone! I've been stuck on a very difficult task for 2 weeks now. The task is to make the ability to swipe cards infinitely, bind them to an array, and implement the structure of the cards themselves in an optimized and competent manner.
I'll describe how I implemented it so that you roughly understand:
I have a card, which consists of a Background. Text. Background image and image. These are 4 elements. Each of them has a local variable id. The text is the same for all projects, so I added a local variable tag and id and attach the text to the card with the tag "Card_Text".
Each ID is attached to each other. That is, the image with ID 6 is attached to card number 6.
Image with ID 3 is attached to the background of card number 3, etc.
I don't know anymore how correct this system is. But containers and families look much worse in my opinion. I don't know. For example, you can't even insert text into a family. And containers are generally unclear how they work and there is no point.
Next, the essence of cards is that they can be moved, and at the same time you can select the one you need by drag and drop. But since there can be more than 1000 values in the array (the array is the inventory of cards). Then I can’t add 1000 cards to the screen, etc. Where each will have 4 elements, this is already 4000 objects, etc. That’s why I came up with an endless swipe, where a card moved to the left will move to the right. and vice versa, when swiping to the right, the card on the right will move to the left. Thus, there will be an endless swipe, plus with the help of a mask and an overlay effect, I will make the card appear in an invisible zone.
The main problem with this system is that when teleporting a card, I try to change its ID so that it is as if next on the list and changes. But the OBJECTS that are in it, the background, the text, etc. -> they change the ID to a completely different one. Although when teleporting, I give everyone -5 or +5 to the ID. Because there are only 5 cards. And it turns out that everything is going in disarray, where the object ID is -15, the background ID is 5, the text ID is -10, etc. I don’t understand why, because the teleportation function is activated once and for them at the same time. A very stupid system that I’m stuck on.
Also, I can’t make a system that these cards need to be dragged onto the table. After all, we can take them and move them higher, but the swipe will still work, and it turns out that when you swipe, the card you’re holding will move, and it will also change its ID if teleportation works on it. Even if you put it on the table to make it inactive, it can still change its ID.
Also, after that, if I move a card to the table (to the center of the screen), then this card should automatically replace its ID with another one from below. Otherwise, they can be duplicated endlessly. This is also a minus. For example, I don’t understand how to implement all this.
I have never seen such a complex system in Construct 3. With my 5 years of experience, I don’t understand anything. What is connected with swipes, cards, and endless systems.
In general, my nerves are already giving out. A lot of problems and loss of motivation. I need help. Please try to explain how to implement such a system. How this system works in other games. And what I need to do. Maybe everything will be done with 2-3 variables, and not 10 like mine... I need optimization and freedom of implementation. Simplicity and ease.. I don't understand.. friends..
I am attaching screenshots of my crooked system.