I'm having an issue...

Get help using Construct 2

Post » Sun Nov 23, 2014 8:32 pm

Hi, my name is Legendary Player Fer. I'm kinda new on Construct 2, but I have some expierence in programming. Now...my problem is this: I'm making an arcade game, which consist of dodging some objects and scoring as long as you dodge them. Now...what I want is that "Every X score points", the game drops a power-up. What I managed to do is that every 15 points, a power-up is dropped, BUT, what happens here is that while you have 15 points (or 30, or 45, or 60, etc), the game keeps dropping power ups. I tied to use global/instance variables to make the game drop only one, but had no luck. Any help would be appreciated. Thanks in advance ^^
B
4
Posts: 8
Reputation: 216

Post » Sun Nov 23, 2014 8:34 pm

Non-triggered conditions will happen every tick as long as they are true.

Adding a "trigger once while true" condition will make it only happen once.
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Sun Nov 23, 2014 8:36 pm

Thanks for the quick answer!! I'll try that as soon as I can and tell you how it came out :D
B
4
Posts: 8
Reputation: 216

Post » Sun Nov 23, 2014 8:52 pm

It worked!! But now, a different problem appeared. The score must strictly be a multiple of 15 in order for the power-up to appear, but, if youd dodge two objects at once, that doesn't always happen (for example, you have 14 points, you dodge two objects, then you get 16 points). Is there a way to make it drop a power up anyway?
B
4
Posts: 8
Reputation: 216

Post » Sun Nov 23, 2014 9:10 pm

maybe like this:

global variable:
next_powerup_at = 15

and event:
(score >= next_powerup_at) : spawn power-up AND add 15 to next_powerup_at
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: 788
Reputation: 3,788

Post » Mon Nov 24, 2014 12:43 am

Yes!!! That's it!!! Thanks man!!!! It worked like a charm!!!! You guys rock!!!
B
4
Posts: 8
Reputation: 216


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests