Scaling a sprite over time

Get help using Construct 2

Post » Tue Nov 12, 2013 6:54 pm

Wow, I did an awful job of explaining this beforehand. I'm periodically creating randomly colored rings that scale up until they are off of the screen (or, technically, until they reach full resolution). It currently looks something like this, with each ring scaling up over time, appearing to move outward:

Viewable on the web: http://bit.ly/1anBGNs

Anyway, it's working satisfactorily right now.moiremusic2013-11-12 20:35:54
B
4
Posts: 25
Reputation: 302

Post » Mon Jan 13, 2014 3:56 am

[QUOTE=R0J0hound]
Another thing you can deal with if you like is what I like to call over shooting. With this event the end scale will likely be a bit more than 1.0. You can use the min() expression to limit the highest value to 1.0 and set up your event like this:
[code]Sprite: myscale<1.0
---> Sprite: set myscale to min(self.myscale + 0.9*dt, 1.0)
---> Sprite: set scale to myscale[/code]
[/QUOTE]

to clarify incase people got stuck like me...

use "Set value" instead of "Add to" while using the min()

or you could just easily use the min() expression on the Set Scale, but probably cleaner to have the instance variable have 1.0 when the sprite is at it's 1:1

thanks @R0J0houndjobel2014-01-13 03:57:54
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Previous

Return to How do I....?

Who is online

Users browsing this forum: Klarner and 25 guests