Initialize Instance

Get help using Construct 2

Post » Tue Dec 06, 2011 10:58 am

...the stupid German again

Is there a way, to run code at the initialization of a Sprite instance?

Example: I have a sprite called Monster and each time an instance is created i want to change the look of the monster by selecting another animation...

B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Dec 06, 2011 11:09 am

[code]Create Monster on layer ... position ...,...
Monster: Set animationFrame to ...[/code]

C2 will automatically pick the instance that is selected but only in the event in which it is selected.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Dec 06, 2011 11:10 am

How about a re-spawn?
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Dec 06, 2011 11:29 am

Add it to the re-spawn event so it both spawns and makes it change the look of the monster then?
B
22
S
3
G
6
Posts: 52
Reputation: 4,387


Return to How do I....?

Who is online

Users browsing this forum: Paradox and 2 guests