How do I add thousand pictures?

0 favourites
  • 7 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • I am making a balloon pop game where there would be ovals flying from down to up and it will have both wrong and right answers

    Clicking on right is reward and wrong would have your score decreased

    Sprite right_answer - eg 1+2=3 , 4+5=9 etc

    Sprite wrong_answer - eg 1+3 = 7, 2+8 = 15

    I used imagemagick to create 1000 pictures(using random numbers) added it to the frames in the sprite and then used "Set animation frame" to random to pick individual frames

    But it looks like game would become very big this way

    Is there a way to generate the images dynamically using construct 3 or are there better ways to do what I am trying to achieve?

  • Probably but we have no idea what you are doing in Imagemagick.

    Just remember memory is memory, if its too much for storage, its too much for ram.

  • Thanks newt for the reply

    This is how I am generating images using imagemagick

    oval.png is the base image

    convert oval.png -resize 240x240 -pointsize 72 -gravity center -annotate 0 1+10=11 correct1.png

    convert oval.png -resize 240x240 -pointsize 72 -gravity center -annotate 0 3+13=16 correct2.png

    convert oval.png -resize 240x240 -pointsize 72 -gravity center -annotate 0 11+14=25 correct3.png

    etc

    Is there a way I can write text inside a Sprite dynamically?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • it would be better to use a sprite font, or even images of the digits to combine into the equations... I am doing a quick sample to show how I might do it...

  • ok, here is a quick sample...

    if the equation is wrong the answer is always 42. if you click it, the bubble turns red. if the equation is correct the bubble disappears.

    the sprite font only has + and -

    and the random distribution of correct / wrong answers isn't very good, but it should get you started.

    https://www.rieperts.com/games/forum/MathBubbles.c3p

  • I think you shouldn't use images for every combination.

    Just use images for your balloon and attach a text or a sprite font to it. You can use a container, or the pin behavior with the auto destroy activated.

    Make an instance variable on the balloon to store the correct answer to check it when the user clicks, and whenever the balloon is generated also update the text or sprite font attached to it. Almost no memory will be used.

  • ok, here is a quick sample...

    if the equation is wrong the answer is always 42. if you click it, the bubble turns red. if the equation is correct the bubble disappears.

    the sprite font only has + and -

    and the random distribution of correct / wrong answers isn't very good, but it should get you started.

    https://www.rieperts.com/games/forum/MathBubbles.c3p

    Sorry for the late reply AllanR as I was updating construct 3 as it was giving the error

    Yes bartallyun, I will try your suggestions too

    Thanks a lot, it works as expected and exactly what I intended to do!

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