How do I make a sprite grow up constantly?

Get help using Construct 2

Post » Wed Dec 31, 2014 6:50 pm

Hello, I'm trying to spawn an object that grow up after it appears...

I would spawn the object with a scale of "0.1" then make it grow to scale "1" but not in one frame... I wanna control the duration of the scale...

I can do it with the "set scale" => "wait 0.01s" => "set scale" => etc... but it's clearly not the good way :mrgreen:

I watched the behaviors and found the "Sline" option, but I'm a bit confuse with the proprieties... I also have troubles with the "set width"...

How should I do please? :mrgreen: It should be easy but how :D ?
B
5
Posts: 46
Reputation: 334

Post » Wed Dec 31, 2014 7:08 pm

Every tick set Sprite.width to Sprite.width + dt*64 <== Pixels per second to grow. Same for Height.

Or, if it gets destroyed at some point you can simply use the sine behaviour, set it to size, and set the time to 2x longer than the life of the object.
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

Post » Wed Dec 31, 2014 7:10 pm

Check this out. It should get you thinking in the right direction. :)

https://www.scirra.com/tutorials/453/growing-buttons
B
62
S
20
G
56
Posts: 1,077
Reputation: 36,021

Post » Wed Dec 31, 2014 8:04 pm

Thank you guys ^^ :)
B
5
Posts: 46
Reputation: 334

Post » Fri Jan 02, 2015 8:32 pm

Great it worked :)

I used this command:


Everytick => Sprite => Width => Sprite.Width+1
=> Sprite => Height => Sprite.height+1

On spawn of Sprite => Set scale to 0.1
=> Wait during 1s
=> destroy :)


In fact I didn't notice the "height" option, I though width meaned "scale" but in fact I miss-translated! xD
B
5
Posts: 46
Reputation: 334


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests