How do I change the size of a sprite gradually ?

Get help using Construct 2

Post » Fri Mar 13, 2015 7:24 pm

EDIT : Check the message under to understand my new problem, thanks :D

Hi ! I'm trying to do a plateform game, but here's my problem :

Before entering the pyramid (where all the levels will be in, like an intro), the player will be moving from the left to the right of the screen. I want to create a depth perception effect, for example the sprite initial size is 30x30 and as he goes further to the right, he'll end at a 5x5 size.

Here's a little drawing I did with paint to help you understand (check the attachment ) :

IMPORTANT DETAILS :

- If the player goes to the left, he gain size, like he becomes bigger going to the left and smaller to the right
- If he keeps going to the right, he can't be under X size, I don't want him to disappear (same for the left)
- The animation must be gradual and smooth, sexier
- I'll love for ever the person that will help me

Thanks :)
You do not have the required permissions to view the files attached to this post.
Last edited by Shortcube on Tue Mar 17, 2015 3:16 am, edited 2 times in total.
B
5
Posts: 10
Reputation: 251

Post » Fri Mar 13, 2015 7:37 pm

Actually nevermind, my friend managed to do it

I've put the how-to-do-it as an attachment
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 10
Reputation: 251

Post » Fri Mar 13, 2015 7:41 pm

You can use linear interpolation functions to change the player's size based on thier X. Have a read up on lerp in the manual.

Player.Width = lerp(30, 5, Player.X/PyramidX)
Player.Height = lerp(30, 5, Player.X/PyramidX)

You can also affect the jump height and walking speed with the same function, to add to the illusion.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Fri Mar 13, 2015 7:44 pm

Oh thank you, I won't say no to more options :)
B
5
Posts: 10
Reputation: 251

Post » Fri Mar 13, 2015 7:55 pm

I have another problem though, before I did the change-size thing, I could have my mirror effect applied for when the Sprite was going to the left, now it's disabled so no mather what I press, it will always face the right and never turn, got any ideas on how to arrange that ?
B
5
Posts: 10
Reputation: 251

Post » Tue Mar 17, 2015 5:25 pm

Up
B
5
Posts: 10
Reputation: 251


Return to How do I....?

Who is online

Users browsing this forum: Myrmex and 1 guest