How do I make an object grow?

Get help using Construct 2

Post » Wed Sep 30, 2015 3:17 pm

I have a coin object. I want it to grow i size when the player touches it.

I can only see how to instantly change it to another size. I want it to grow steadily in size.
B
6
S
1
Posts: 33
Reputation: 495

Post » Wed Sep 30, 2015 3:25 pm

Player is overlapping "Coin"
Every [delay] seconds
-Coin
set size to self.width+[value], self.height+[value]
B
9
S
3
Posts: 153
Reputation: 1,272

Post » Wed Sep 30, 2015 3:33 pm

If the player touches it and moves away I want the effect to still happen.

Currently the effects are triggered "On collision with Player"

How do I have the coin grow in size in this event?
B
6
S
1
Posts: 33
Reputation: 495

Post » Wed Sep 30, 2015 3:40 pm

Make a boolean for the coin object "grow"
Player is overlapping "Coin"
Coin set grow to true

Coin
Is grow
Every [delay] seconds
set size to self.width+[value], self.height+[value]
B
9
S
3
Posts: 153
Reputation: 1,272

Post » Wed Sep 30, 2015 3:44 pm

Won't this make all coins on the screen grow and not just the one the player touched?
B
6
S
1
Posts: 33
Reputation: 495

Post » Wed Sep 30, 2015 4:04 pm

Did you set the boolean to false by default?
Should only affect the coins that have the "grow" boolean active
B
9
S
3
Posts: 153
Reputation: 1,272

Post » Wed Sep 30, 2015 4:06 pm

Ahh an instance variable I see. I was thinking global variable for some reason

Thanks that should work perfectly :D
B
6
S
1
Posts: 33
Reputation: 495

Post » Wed Sep 30, 2015 4:13 pm

How do I include "every [delay] seconds" in the conditions for the grow event?

Currently I have a Coin event:

condition: Is Grow
action: Coin -> Set size to (self.Width + 1, self.Height + 1)



This works fine but what if I wanted to do it your way where it has a delay. Would that be another condition? I don't see a way to do an "every delay seconds" type of condition for an object. Only for system
Last edited by akjoltoy on Wed Sep 30, 2015 4:14 pm, edited 1 time in total.
B
6
S
1
Posts: 33
Reputation: 495

Post » Wed Sep 30, 2015 4:17 pm

If you select an event and press B you will make a sub-event. Sub-events will only happen if their parent event is activated and its own condition is correct
Image
B
9
S
3
Posts: 153
Reputation: 1,272

Post » Wed Sep 30, 2015 4:18 pm

Awesome thanks again
B
6
S
1
Posts: 33
Reputation: 495

Next

Return to How do I....?

Who is online

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