Destroy Instances if... (SOLVED)

Get help using Construct 2

Post » Fri Nov 16, 2012 5:38 am

Hey all, i'm figuring out, i made a .capx which i don't know how to destroy the instance if the frames aren't equal.

I wanted you can destroy a instance when 4 circles their frames are different, not equal

-(1) (2) (3) (4)

-(2) (1) (4) (5)

You can click any instance to destroy if their frames aren't equal to other instances.


Otherwise YOU can't destroy an instance if their frames are equal like:

- (2) (2) (1) (1)

- (3) (4) (1) (3)

- (5) (5) (2) (5)

Here is .capx


http://dl.dropbox.com/u/76227787/FrameInstanceDestroy.capx

Do you have an idea how to fix?


Thanks!Joannesalfa2012-11-17 01:59:31
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Fri Nov 16, 2012 5:39 pm

Hi,

I'm not exactly sure if this is what you wanted, but here goes:

http://dl.dropbox.com/u/33370253/FrameInstanceDestroy_.capx
B
157
S
114
G
8323
Posts: 42
Reputation: 4,170,239

Post » Fri Nov 16, 2012 6:00 pm

Destroy just the one you click on if it doesn't match any other. Is that right? destroyNotMatching.capx (r109)
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Nov 16, 2012 10:47 pm

[QUOTE=aruche] Hi,

I'm not exactly sure if this is what you wanted, but here goes:

http://dl.dropbox.com/u/33370253/FrameInstanceDestroy_.capx[/QUOTE]

@aruche Yes! it worked now, actually i have a question, how to setup codebase to apply Array.Height, to make sure ALL circles

Like this

Height 1- (1)(2)(4)(5)
Height 2- (3)(6)(7)(8)

If all circles their frames aren't equal, it can destroy an instance

Your .capx can destroy the instances if the frames aren't equal on height number 2

Height 1- (3)(3)(2)(1)
Height 2- (1)(2)(3)(4)

If all circles on height 1 their frames are equal, it cannot destroy the instances, but on height 2 their frames aren't equal, it can destroy the instances.

Is supposed to do not destroy an instance in height number 2 because the circles on number 1, the frames are equal.

Thanks!Joannesalfa2012-11-16 22:57:14
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Fri Nov 16, 2012 10:50 pm

[QUOTE=ramones] Destroy just the one you click on if it doesn't match any other. Is that right? destroyNotMatching.capx (r109) [/QUOTE]

Hello @Ramones, oops your URL is broken.
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Sat Nov 17, 2012 1:42 am

[QUOTE=Joannesalfa]Is supposed to do not destroy an instance in height number 2 because the circles on number 1, the frames are equal.[/QUOTE]

Is the converse also true? For example:
Height 1- (1)(2)(3)(4)
Height 2- (3)(3)(2)(1)

Can instances at Height 1 be destroyed?

Examples:
As long as the current row or any row above the clicked/touched instance has non-unique values, it cannot be destroyed:
http://dl.dropbox.com/u/33370253/FrameInstanceDestroy_2.capx

As long as there's a row with non-unique values in the entire array, nothing can be destroyed:
http://dl.dropbox.com/u/33370253/FrameInstanceDestroy_3.capxaruche2012-11-17 01:46:15
B
157
S
114
G
8323
Posts: 42
Reputation: 4,170,239

Post » Sat Nov 17, 2012 1:55 am

[QUOTE=aruche] [QUOTE=Joannesalfa]Is supposed to do not destroy an instance in height number 2 because the circles on number 1, the frames are equal.[/QUOTE]

Is the converse also true? For example:
Height 1- (1)(2)(3)(4)
Height 2- (3)(3)(2)(1)

Can instances at Height 1 be destroyed?

Examples:
As long as the current row or any row above the clicked/touched instance has non-unique values, it cannot be destroyed:
http://dl.dropbox.com/u/33370253/FrameInstanceDestroy_2.capx

As long as there's a row with non-unique values in the entire array, nothing can be destroyed:
http://dl.dropbox.com/u/33370253/FrameInstanceDestroy_3.capx[/QUOTE]

@aruche

FrameInstanceDestroy_3.capx is a great solution! That's all i wanted, you're really a helpful person.


I will owe you one if you pm me for specificed development.

Thank you a lot!Joannesalfa2012-11-17 01:59:58
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Kagubro, kentbakk and 20 guests