Sprites that morph

Get help using Construct 2

Post » Fri Mar 29, 2013 10:39 am

I need to know how to replace a sprite with another sprite while the player is standing on it

Im trying to make platforms that change colour or have different collisions based on triggers. For example, a green rectangle turning into an orange circle on the trigger of a button

One problem that comes up is that when the sprite "morphs", since the circle is bigger than the rectangle, the player gets stuck in the circle if he was standing on the rectangle

Id also like to know if I can carry a variable across when the sprite changes, or how to set the new sprite to the same angle(some platforms may be rotated)
B
2
Posts: 8
Reputation: 316

Post » Fri Mar 29, 2013 11:07 am

Use different animations instead of different sprites. For the overlap maybe after the morph have a loop: while player is overlapping platform -> move up 1 px.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Fri Mar 29, 2013 6:18 pm

Unfortunately my player has durations where he is upside down, and as I just found out, setting his position a few pixels up just lodges him back in an endless loop
B
2
Posts: 8
Reputation: 316

Post » Fri Mar 29, 2013 11:05 pm

You could move away from the centre of the platform with 'move at angle' and the angle:
angle(platform.x, platform.y, player.x, player.y)

Or move in the opposite direction to gravity.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests