splitting instances

For questions about using Classic.

Post » Tue Sep 29, 2009 10:02 pm

if 2 instances collide how do you give them each another action to do?

the instances where created in runtime, so i can't give them a fixed number, my problem is mostly how can i pick them apart?
B
2
G
3
Posts: 72
Reputation: 994

Post » Wed Sep 30, 2009 12:46 am

The easiest way of doing this is to add the object into a family, then checking for collisions between an object and the family it's part of. For example:

+ On collision between Sprite and Family
- Destroy sprite
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Wed Sep 30, 2009 2:48 pm

you can also give the same object 2-or-more families to have 3-or-more way collision/picking descrimination.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Sep 30, 2009 4:02 pm

thanx, i didn't think of colliding with family, but when i use that i still can't give them each a seperate action

and i cant use more family's because i cant control what family's will collide

say that i want each sprite to move to a different location when colliding

or can i give the one that collides with family a pv and the one in the family a pv?
B
2
G
3
Posts: 72
Reputation: 994

Post » Wed Sep 30, 2009 8:32 pm

you would control the family one through the family name

like circle is in family shape
if circle collides with shape
move circle to the left
move shape to the right

they're still both circles, but you can control them seperately
by using the object and it's family as separate entities
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Oct 02, 2009 9:27 pm

thanx for the help, i thought when i collided with family and i give family somthing to do, the whole family would do it, but its just the one in the collision event

i also found that with system collision advanced, you can pick on of the two in collison, you could get it to work with that too
B
2
G
3
Posts: 72
Reputation: 994


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest