Match 2 sprites and destroy(Solved)

For questions about using Classic.

Post » Thu Jul 07, 2011 12:34 pm

Thanks ROJOhound, works perfectly now.
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Thu Jul 07, 2011 4:03 pm

[QUOTE=chrisbrobs] Thanks ROJOhound, works perfectly now. [/QUOTE]


I am trying to incorporate your solution into my cap, and for some reason i can't get it to work.

Couple of questions:

Event 3
   + cover: Opacity Equal to 10
   + System: CountMatching(cover.OID) Equal to 2

What exactly does the second line of event 3 do. Iv'e not seen this expression before ?

Is the group 'playing' active at start?

Sorry for the million questions, but i need to sort this.

Cheers

B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Thu Jul 07, 2011 6:26 pm

OID is object id, a specific number given to each different type of object.
In this case its the object cover.
So basically is saying if object cover's opacity is equal to 10, and if the number of the objects called cover placed into the selected objects list is 2... do stuff.
Not to be confused with UID, a specific value assigned to each individual instance of an object.newt2011-07-07 18:28:17
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Thu Jul 07, 2011 7:46 pm

[QUOTE=newt] OID is object id, a specific number given to each different type of object.
In this case its the object cover.
So basically is saying if object cover's opacity is equal to 10, and if the number of the objects called cover placed into the selected objects list is 2... do stuff.
Not to be confused with UID, a specific value assigned to each individual instance of an object.[/QUOTE]


Thanks for the info newt, this part makes sense now.

-------------------------------------------------------

ROJOhound wrote:
"Here is a corrected cap where only the mismatched cards are reset.
http://dl.dropbox.com/u/5426011/examples5/cardmatch2.cap"


I transfered the events to my cap, and it works, as far as making the 2 cards 10% opaque.

If you have a spare bit of time, heres my cap, with yours added at the end.
(run it, and press keyboard 2 to activate the memory match bit)

nightmare

B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Thu Jul 07, 2011 10:06 pm

I got it working:
http://dl.dropbox.com/u/5426011/fixed/chrisbrob.cap

10% opacity was not working so I switched it to 25%.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Thu Jul 07, 2011 10:40 pm

[QUOTE=R0J0hound] I got it working:
http://dl.dropbox.com/u/5426011/fixed/chrisbrob.cap

10% opacity was not working so I switched it to 25%.[/QUOTE]


WOW....i am truly amazed ROJOhound !

I was just about to put the project in my 'Can't be done' folder and you come up a solution?

Amazing considering there's about a million groups in the cap.

Thank's for all your help.
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Thu Jul 14, 2011 11:26 pm

ROJOhound

Thanks for your previous help with the above.
I am trying to recreate the events, but instead of using the transparency as a trigger i want to use a card (or cover) with 2 animations 'facedown' and 'faceup'(obviously this is the card that covers the blocks).

Ive been trying to work this out for 2 days, but it just wont work.

If you get a minute, would you have a look at it.

This link is a screenshot of the current events (the original)

Solution



I havent bothered including the events i have tried because its a bit of a mess!

Thanks in advance.
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Thu Jul 14, 2011 11:49 pm

I did this once using a "flipping" technique.
+>pv selected is equal to 2
->sprite set width to lerp(.width,.orginalwidth-.orginalwidth, 1-0.5^timedelta)

+>pv selected is equal to 1
->sprite set width to lerp(.width,.orginalwidth, 1-0.5^timedelta)

+>sprite compare width >0 sprite set animation frame to 1

+>sprite compare width <0 sprite set animation frame to 2
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Jul 15, 2011 10:47 am

Thanks for the example newt, thats a good method for the 'flipping' of the card, the problem im having is replacing the events that depend on the Transparency factors.
I thinks it because the 'card' and 'block' are in a container? which i haven't used before.
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Sun Jul 17, 2011 8:01 pm

chrisbrobs,
There are a lot of changes needed to make it work. My approach would be to scrap the events I gave you before and start anew.

Here is an updated example.
Layout 1 is just basic matching, but I think is pretty jarring.
Layout 2 has smooth card transitions which is more visually pleasing.
http://dl.dropbox.com/u/5426011/examples5/match.cap
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest