Association and picking problems

Get help using Construct 2

Post » Fri Sep 12, 2014 7:36 pm

In my game, Psi, I often have at least a few instances of the same enemy on screen at a time. I use rectangular sprites for my collision detectors and have my spriter animations associated with the sprite by UIDs, etc. The problem I have is in spawning other effects--fire for example. How do you get the right effect associated with the right sprite and animation. For instance, let's say you have box 1. After a certain attack you want to set the target on fire so you spawn fire 1 and now try to apply it to the enemy so it stays with them and in the proper z order etc. What picking method would you use? Pick box where box.number = fire.number doesn't seem to be enough to associate the 2. How do you do it? Thanks.
Image
B
20
S
4
Posts: 382
Reputation: 2,974

Post » Sat Sep 13, 2014 1:47 am

There are 2 ways that I know of. The first one is to use a container. The second one is to use the UID of an object and link it to an other with an instance variable. See the attached example.

UID vs Container Picking.capx


-EDIT- Unless you mean associate within Spriter, in which case I don't know, I haven't used Spriter enough yet, I am wating for v.1 to come out first.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Sun Sep 14, 2014 3:20 am

@eli0s - thanks for sharing this, you have been a great help to me. :D I was trying to use the pick behavior but all I had to do was set and compare the ID variable. Thanks so much!
Image
B
20
S
4
Posts: 382
Reputation: 2,974

Post » Sun Sep 14, 2014 3:10 pm

That's great! :)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829


Return to How do I....?

Who is online

Users browsing this forum: Fradno, marcinkowski, tarek2 and 11 guests