[Solved-Thanks]add 1 to count, Yes just 1 this time.

Just started using Construct 2? Post your questions here

Post » Wed Aug 31, 2016 1:28 am

How to keep add one to count to one time a round.
Right now I can click on sprite 10 times with a score of 10.
I just want it only add 1 to count? Right?

Image

seems like every time I make a scoreboard a click is like 10, or 19, etc..
Last edited by DeathSpecter9 on Wed Aug 31, 2016 3:18 am, edited 1 time in total.
B
31
S
13
G
1
Posts: 41
Reputation: 2,958

Post » Wed Aug 31, 2016 2:53 am

Does the "Family1 > Is on layer 5" need to be a condition?
Try adding the "Trigger once" condition to the
"Touch > On touched Family1" instead of as a sub event.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Wed Aug 31, 2016 3:18 am

Thanks you got me thinking, Here's what I ended up doing.

Image

Oh I also added
Image
B
31
S
13
G
1
Posts: 41
Reputation: 2,958

Post » Wed Aug 31, 2016 3:29 am

I see you've solved your problem, but here's a little info for ya, anyway:

If the 'Family1 is on Layer 5' is necessary, you just need to add it to the touch condition (as in 'on touch Family1 AND Family1 is on layer 5). You could also put it as a subevent to the touch condition.

Triggers shouldn't be used in subevents. Nor should they need "trigger once" added to them.


EDIT: I wouldn't get in the habit of setting text every tick if you don't have to, it can really slow things down sometimes..
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Wed Aug 31, 2016 3:41 am

Thanks Noted.. resolving...
B
31
S
13
G
1
Posts: 41
Reputation: 2,958

Post » Wed Aug 31, 2016 3:45 am

Ok here we go.
Like this? And should I remove the on startlayout text?
Image
B
31
S
13
G
1
Posts: 41
Reputation: 2,958

Post » Wed Aug 31, 2016 3:53 am

It works, right? As long as it's working like you want, then yes! There's nothing extraneous or awkward going on like before. I can tell ya that.

You can have the text initially be set to "0" in C2, but doing the startlayout is fine, too. It doesn't make any real difference that I can think of..
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Wed Aug 31, 2016 6:16 am

Yep it works! Thank guys

You site is really good.
I don't like scarecrows laughing at me. :oops: :lol:
B
31
S
13
G
1
Posts: 41
Reputation: 2,958


Return to Beginner's Questions

Who is online

Users browsing this forum: FartsLolz and 1 guest