Math game

Get help using Construct 2

Post » Wed Jun 19, 2013 10:24 pm

I would like to know how could I make it so that when I eat X fly ex.(4) that the number 4 appears below and then if I eat Y fly ex.(6) 6 appears right next to 4 with a + symbol indicating the kid that he is adding 6 to 4.

All help will be greatly appreciated.

https://dl.dropboxusercontent.com/u/19845326/frogtest.capx
B
6
S
1
G
2
Posts: 19
Reputation: 1,717

Post » Wed Jun 19, 2013 10:29 pm

Give the fly an instance variable, then put up the number for the eaten fly's variable.
B
44
S
13
G
7
Posts: 603
Reputation: 7,936

Post » Fri Jun 21, 2013 12:15 am

Could it be possible that you could be a little more specific or better yet edit the .capx accordingly?

I understand I've already tried what you propose but it wasn't exactly working as desired because all of the textboxes ended up being the same number.

If i ate 4 first the first box would be 4, and when I ate 5 afterwards both boxes would turn to 5.
B
6
S
1
G
2
Posts: 19
Reputation: 1,717

Post » Fri Jun 21, 2013 3:06 am


sorry tried to assist but can't as you are using a SpriteFont plugin which I lack and will not be installing

hopefully the official SpriteFont plugin will be created soon so then can use that.
B
40
S
12
G
6
Posts: 136
Reputation: 6,347

Post » Fri Jun 21, 2013 3:33 am

I removed the SpriteFont object, does it work now?
B
6
S
1
G
2
Posts: 19
Reputation: 1,717

Post » Fri Jun 21, 2013 5:10 am

@aroh
does open will take look see what can find

----
eat X fly ex.(4) that the number 4 appears below and then if I eat Y fly ex.(6) 6 appears right next to 4 with a + symbol indicating the kid that he is adding 6 to 4.
----
Pic below to help
What I see happening so far is there is the # (16) created randomly at beginning is what is needed and the gray circles become red based on the # on the fly hit with the tongue

The number in yellow box (5) is the total of the flies the user has hit (4+1, 3+2)
If I go over the number in blue box (16) I fail.

~~~~~~
Based on your description of what you want this is practically the opposite.

Are you wanting the user to create own equation? or wantin predetermined #?

please reply using @DrGreenThumbCAN so can be notified
I initially didn't because I couldn't assist you due to plugin incompatibility.DrGreenThumbCAN2013-06-22 10:11:26
B
40
S
12
G
6
Posts: 136
Reputation: 6,347

Post » Sat Jun 22, 2013 7:10 am

@DrGreenThumbCAN

I merely want the bottom text boxes to show the number of the fly you just ate in the order they were eaten, no changes to the current code whatsoever.

If I ate fly #5 first then it appears in the first textbox which would be the one showing 0 in the picture.
If I then ate fly #3 then the second textbox would show number 3.
And so on.
B
6
S
1
G
2
Posts: 19
Reputation: 1,717

Post » Sat Jun 22, 2013 10:21 am

@aroh
ok thanks for clarifying will try to implement this directly into your existing project if can't I'll make a comparable example so you can work it in your self how you wish
work weekends so will do asap
sorry if wait maybe someone can ninja it for you while I'm at work if need sooner
B
40
S
12
G
6
Posts: 136
Reputation: 6,347

Post » Sat Jun 22, 2013 9:43 pm

@DrGreenThumbCAN

Thanks I'll wait for your reply.
B
6
S
1
G
2
Posts: 19
Reputation: 1,717

Post » Sun Jun 23, 2013 11:33 pm

@aroh
  • added texts into a family
  • add global variable hitCount - keeping track of # of bugs hit (start at 0 so can choose first instance in text family - because family indices are 0-based)
  • after each collision the textbox is chosen based on hitCount using Pick Family instance int(hitCount)
  • add value of bug ate to picked textbox
  • add 1 to hitCount so next bug's value is added to next textbox
  • on start of layout set hitCount to 0 so can restart Pick Family cycle of textboxes

I've left in line comments also to hopefully help better understand


frogtestEDIT-R132

  • added FPS text 25/06
  • DrGreenThumbCAN2013-06-25 18:45:23
    B
    40
    S
    12
    G
    6
    Posts: 136
    Reputation: 6,347

    Next

    Return to How do I....?

    Who is online

    Users browsing this forum: lennaert, ThePakernator and 9 guests