How do I exchange an object's sprite?

Get help using Construct 2

Post » Thu Jun 19, 2014 12:02 pm

Hi,
I want to exchange my sprite's image based on events. I want to avoid destroying my sprite object and spawning a different one in order to not lose its behaviors and variables. Is there functionality for this or do I need a different approach?
B
13
S
6
Posts: 222
Reputation: 1,859

Post » Thu Jun 19, 2014 12:03 pm

easiest way is by setting up different animations for the sprite. based on the event, just change the animation to be shown.
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Thu Jun 19, 2014 12:22 pm

that seems like an easy solution, thanks. however ideally I'd like to ben able to apply external sprites, like say the same sprite I'm colliding with, referencing that same image file. Is there a way to do that, referencing another sprite to switch to?
B
13
S
6
Posts: 222
Reputation: 1,859

Post » Thu Jun 19, 2014 12:26 pm

I'm not sure if I understood of what you try to achieve.

Do you mean:
You have one sprite that you control and when you collide with that sprite at another sprite your sprite will have the same image as the other sprite?
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Thu Jun 19, 2014 12:35 pm

yes, pretty much. although I'd should not need to be that exact same one I switch to, Just switching to some other image, presumably refrenced through another sprite object. say my player sprite collides with some npc sprite, upon which he takes on a different image. that different image I'd like to be able to reference differently than by switching to a different preassigned animation, I'm guessing that there might by a way to reference the image of another sprite somehow..?
B
13
S
6
Posts: 222
Reputation: 1,859


Return to How do I....?

Who is online

Users browsing this forum: asdtricky, pmerineau, Yarfapet and 12 guests