How do I do cumulative points?

Get help using Construct 2

Post » Wed Jun 04, 2014 10:08 pm

In my Star Catcher game I want to have cumulative points for consecutively catching the same type of star.

for example for the one point stars, after you catch your first one the nest one is two points, the next three and so on and so forth.

Thanks!
B
10
S
1
Posts: 69
Reputation: 641

Post » Wed Jun 04, 2014 10:41 pm

Have a variable that is incremented each time a player catches a star and have it add to your score each catch and reset to 0 when you miss one.

You could also have an instance variable on the star itself which will increment by 1 each time a new one is spawned if the player is on a streak.
B
6
S
2
Posts: 16
Reputation: 582

Post » Wed Jun 04, 2014 10:58 pm

How would I do the second method? I just added the instance to my star and called it "streak".
B
10
S
1
Posts: 69
Reputation: 641

Post » Wed Jun 04, 2014 11:09 pm

Here is a simple example, left click to spawn a dot , arrow keys to move the player.
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 16
Reputation: 582

Post » Wed Jun 04, 2014 11:11 pm

Thanks! I'll let you know if this helps.
B
10
S
1
Posts: 69
Reputation: 641

Post » Wed Jun 04, 2014 11:21 pm

No problem, you could also do a streak variable if you don't have a ground object.
B
6
S
2
Posts: 16
Reputation: 582

Post » Wed Jun 04, 2014 11:46 pm

I don't have a ground object, how would I do a streak variable?
B
10
S
1
Posts: 69
Reputation: 641

Post » Wed Jun 04, 2014 11:52 pm

Instead of having the score reset when it hits the ground, just create a streak variable( -1 for off 1 for on) and have the cumulative variable reset when the streak variable is off.

I'm not sure how your game is set up, but when you miss a star just have it set the variable off or just have it reset the cumulative variable. It should be pretty easy to set up from the example I provided.
B
6
S
2
Posts: 16
Reputation: 582

Post » Thu Jun 05, 2014 12:02 am

well my game is a "catch stuff as they fall" game and there are other stars too so I'm setting it up where I ad one to streak everytime you catch a 1 pt star but its reset to zero on other stars and space junk.

Edit: IT WORKED!!!!!

Now I just want to ask how can I give ten bonus points for every ten one point stars that are caught.
B
10
S
1
Posts: 69
Reputation: 641

Post » Fri Jun 06, 2014 11:13 pm

kristithechocobo wrote:well my game is a "catch stuff as they fall" game and there are other stars too so I'm setting it up where I ad one to streak everytime you catch a 1 pt star but its reset to zero on other stars and space junk.

Edit: IT WORKED!!!!!

Now I just want to ask how can I give ten bonus points for every ten one point stars that are caught.


Basically the same way. Just create a variable that is increased by 1 every time a star with a value of 1 is caught, then when that variable = 10 give them 10 bonus points and reset it.
B
6
S
2
Posts: 16
Reputation: 582

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev, kainrazial and 8 guests