Numbering instances of an object

Get help using Construct 2

Post » Wed Mar 06, 2013 3:32 am

I'm working on a game with 9 individual rooms in a 3x3 grid. I have a Spawner object in the center of each room (The same object, different instances) and I need to number them according to their room. Since they are all the same object I can't just put the room number in a instance variable during editing. I also can't use multiple objects due to other reasons.

So how can I number an instance variable based on my decision?
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Wed Mar 06, 2013 5:01 am

Are you placing them during design time or creating them during runtime?

If you're placing them during design time, you can, in fact, set their instance variables.

If you're creating them during runtime, you should be setting their instance variable when you create them.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Wed Mar 06, 2013 2:47 pm

@theubie I create them during design time. I just tried changing it and noticed I can change the value for a single instance in the properties bar. I didn't notice that and I was opening the ui for all of them and changing it there.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Wed Mar 06, 2013 4:22 pm

Your discovery has gotten you one step closer to being an sprite instance master, grasshopper!
B
26
S
8
G
3
Posts: 210
Reputation: 5,973


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests