How do I attach random texts to image?

0 favourites
  • 3 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • Hi everyone, hope you are doing great,

    I am working on this game where you have to drag falling cards to a good/bad bin depending on their content.

    Right now I have 20 different images with their content already embed, and I can say if they are good/bad using an instance. (20 frames on the sprite animation, if animation.framecount is less than 10, set instance as good, if it´s more than 10 set instance as bad) on drop, it compares the instance and if matches, user gets 1 point

    This works fine, however, I would like to have more options without making dozens of cards/frames, mostly, because of the final loading times.

    I am trying to think how this should work, cards have Bullet behavour, and they are created every x seconds on the top of the layer.

    How can I attach different texts to different cards? Is this something doable, or am I overcomplicating things? Should I just go with image cards?

    If you think there´s a good workaround, where should I start looking? arrays? I´m not a complete unexperienced here, but I´m far far from being good with them

    Thanks so much in advance for any tips :D

    Have a great day!

  • Don't assume loading time is a problem unless you can measure it.

    The easiest way to associate different text with 20 frames is to write a function that given a number (frame) returns a string (text). Just run through 20 if statements and set the return to the string you want for that frame.

    yours

    winkr7

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • winkr7 thanks so much for your message, I am not having struggle with generating random or frames, maybe (possibly) I didn´t explain myself better...

    I have random falling cards, with random falling numbers, that the user needs to drag to the correct bin before they reach the bottom of the screen.

    How can I pin the random generated text to the random generated card so user can drag both at the same time?

    If I pin the text to the card, next time a text is created it pins to that card, not the new one.

    If I set the position of the text, same happens.

    I would basically need to create both card and text, pin them together, and move them together.

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