How do I make random generated math calculations?

Get help using Construct 2

Post » Tue Sep 08, 2015 7:18 pm

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:
Image
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!
Last edited by patrickscheper on Tue Sep 08, 2015 7:48 pm, edited 1 time in total.
B
3
Posts: 6
Reputation: 191

Post » Tue Sep 08, 2015 7:33 pm

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?
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue Sep 08, 2015 10:23 pm

This was actually a response to another topic....( How do I create sprites thats contains number to operate? )

Operators.capx

Image

but... very similar....

Operators_II.capx

Image
Image
B
64
S
23
G
7
Posts: 1,482
Reputation: 10,825

Post » Fri Sep 11, 2015 10:54 am

Thank you guys, know how to start now!
B
3
Posts: 6
Reputation: 191


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 7 guests