Increase object size over time

Get help using Construct 2

Post » Tue Sep 17, 2013 6:18 pm

I've been stuck on this for the last couple of days, and I have searched through google and the FAQ, but to no success.

Upon creation I want to increase the both the height and width of an object over a period of time, so say that it starts at 40 pixels width, and 80 pixels height, and 4 seconds it goes to be twice its original size, and we see it grow as if it was an animation.

I'm not really sure where to start with this, I have tried several different conditions, but none seem to work.

Thanks in advance.
B
3
Posts: 5
Reputation: 414

Post » Tue Sep 17, 2013 6:26 pm

Growing over time:
Every tick > Set Height = Sprite.Height+1
Every tick > Set Width = Sprite.Width+1

Adjust growth speed/amount as needed

And I made .capx example for you > LINKplinkie2013-09-17 18:50:03
B
46
S
16
G
77
Posts: 2,155
Reputation: 45,823

Post » Tue Sep 17, 2013 6:30 pm

you can do :
system > every 4 seconds
set sprite size to (self.width * 2, self.height *2)
Might help maybe.
B
28
S
6
G
2
Posts: 86
Reputation: 3,267

Post » Tue Sep 17, 2013 6:57 pm

You can also use scale.

I did a video a while back called Growing Buttons. You might be able to use something from it.
http://www.youtube.com/watch?v=ADzH2jQS0ek&noredirect=1
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667

Post » Tue Sep 17, 2013 7:57 pm

Do you have a capx for that video? A 9 minute tutorial seems a bit long.
B
9
S
3
G
1
Posts: 191
Reputation: 1,725

Post » Tue Sep 17, 2013 8:46 pm

Thanks for the feedback everyone :D.

Unfortunately, I can't seem to make it increase in size when it is created. The idea is that similar to a grenade, when the grenade object hits the floor, it is destroyed and a new object is spawned, which is the object that increases in size.

Every time the new object is created it doesn't increase in size, it stays the same, not sure what I am doing wrong :/.
B
3
Posts: 5
Reputation: 414

Post » Tue Sep 17, 2013 8:57 pm

Please post a .capx or screenshot of the events and I'm sure I can solve this.
B
46
S
16
G
77
Posts: 2,155
Reputation: 45,823

Post » Tue Sep 17, 2013 9:52 pm

https://www.dropbox.com/s/gl3ivcslqku18nh/Proto1.capx

It is under the group bomb.

I actually got it working, but for some reason I can't do it twice, or after a certain time period.
B
3
Posts: 5
Reputation: 414

Post » Tue Sep 17, 2013 10:46 pm

Yeah it doesn't like the Wait the second time round.
Anyway, a quick fix for this is to add a condition under Every Tick > Laser 2 Is On-Screen. It checks Every Tick that Laser 2 has been created and then runs the growth.plinkie2013-09-17 23:07:16
B
46
S
16
G
77
Posts: 2,155
Reputation: 45,823


Return to How do I....?

Who is online

Users browsing this forum: Waltuo and 30 guests