How do I make random generated math calculations?

0 favourites
  • 4 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hi there!

    First time posting here! Have been using Construct 2 for almost a year now. Made some entertainment games with it. (Top down shooter/roguelike, endless runner ect.)

    Has been really fun, and now I am looking into serious gaming more.

    I had a really cool idea for a math calculation game for the appstore, here is the example I made for you guys:

    Just save it, it's too big!

    Only problems is the random math calculations. It should first make a calculation, and then delete the -,+,/ or x.

    This caculation Construct 2 would make can't be a complicated one at first. (Maybe for an easy level just have calculations that go till 10, and a normal one till a 100.)

    I've done some crazy stuff with Construct 2, but this is too complicated for me, and there are NO tutorials for this kind of thing.

    I really hope somebody could help me out.

    Thank you so much!

  • 1) Save your equation to a string (equation = "45*31-187")

    2) add the Browser object to your project

    3) set the value of your result variable to: browser.execjs("eval("&equation&")")

    result now holds the the result of your equation.

    Generating random integers from x to y is done with int(random(x,y+1))

    The rest should be straight forward and only limited to your creativity, no?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This was actually a response to another topic....( How do I create sprites thats contains number to operate? )


    but... very similar....


  • Thank you guys, know how to start now!

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