[SOLVED] How to replace sprite with another?

Get help using Construct 2

Post » Sun Mar 02, 2014 5:44 pm

Player > On collision with cupcake

So when my player catches the cupcake, how do I replace the sprite itself with another (PlayerEat) sprite.

Image
Last edited by smokeyb on Sun Mar 02, 2014 7:40 pm, edited 1 time in total.
B
7
Posts: 17
Reputation: 346

Post » Sun Mar 02, 2014 5:55 pm

You generally Spawn a new one, and Destroy the old one. Or, you'd change the animation instead.
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Sun Mar 02, 2014 6:22 pm

How would I change the animation without affecting the original sprite?
B
7
Posts: 17
Reputation: 346

Post » Sun Mar 02, 2014 6:34 pm

Not sure what you mean. The original would be the first animation. The eating would be the second.
Maybe post what you have if this still isn't making sense.
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Sun Mar 02, 2014 6:46 pm

https://dl.dropboxusercontent.com/u/152 ... index.html

I guess I'm not entirely sure how to make a second animation.

I'm referring to the "Edit animations" feature and the animation frames I guess.
B
7
Posts: 17
Reputation: 346

Post » Sun Mar 02, 2014 6:49 pm

See the Animations tab in Manual for more details.
You simply have to create a new animation by right clicking and importing or drawing a frame.

Another alternative way is to Use the same animation with speed set to 0 and set animation frames instead.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sun Mar 02, 2014 6:50 pm

When you open a Sprite, there's an Animations panel. The first is Default. Right-click to Add animation, and now you've got a second animation to work with.

Use Sprite.Set animation to set it to the 'eat' animation at the appropriate time.
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Sun Mar 02, 2014 7:39 pm

Right, got it. Thanks a lot guys.
B
7
Posts: 17
Reputation: 346


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, Yahoo [Bot] and 16 guests