How do I change a sprite image when an object takes damage?

Just started using Construct 2? Post your questions here

Post » Fri Dec 04, 2015 3:40 pm

The subject line pretty much says it. I want to change the original image to another image which shows 'damage'. Have heard of a 'file chooser' plugin that I think does that, but couldnt find it anywhere. Are there also other ways to do it?
B
9
S
3
Posts: 31
Reputation: 708

Post » Fri Dec 04, 2015 3:55 pm

Hi @delusan

You can make use of the 'Set Animation' action.

Firstly you'll need to create the damage animation. If you double click the sprite in the main area of C2 you'll see a list of animations pop up. You can right-click here and create an animation called Damage and then drop the relevant image(s) in. This could be one or many frames.

Then on the event sheet, wherever the logic is for taking damage, choose the action 'Set Animation' and choose the 'Damage' animation you created.

You'll also need to create some logic for when the player is NOT taking damage, to set the animation back to the original image.
B
44
S
13
G
59
Posts: 1,785
Reputation: 35,768

Post » Fri Dec 04, 2015 4:34 pm

Thank you, plinkie. Do you know anything of a 'choose file' plugin?
B
9
S
3
Posts: 31
Reputation: 708

Post » Fri Dec 04, 2015 4:37 pm

delusan wrote:Thank you, plinkie. Do you know anything of a 'choose file' plugin?


That plugin is one of the standard ones that come with C2 - https://www.scirra.com/manual/182/file-chooser.

What version of C2 are you using?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,194
Reputation: 54,293

Post » Fri Dec 04, 2015 4:44 pm

Very very embarrassed zenox98 - in Form Controls - right in front of my eyes.
B
9
S
3
Posts: 31
Reputation: 708


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests