Match picture to name

Get help using Construct 2

Post » Thu Jul 19, 2012 4:07 pm

Hi

I'm trying to make a simple quiz game.

It writes the name of a flower, and you have to click the right picture between 30 different ones.

I can make it work, but each flower-picture gets a really long click-event, which I have to copy and change variables to all 30 pictures.

My code is ugly, so I just ask - what would be the simplest way to do this?

(I put picture UIDs and names in 2 arrays, donno if that helps).

I've made a few other games, but have I already met Construct 2's limit?
B
5
Posts: 37
Reputation: 840

Post » Thu Jul 19, 2012 4:44 pm

Have one flower object with a different animation for each type of flower. Then just compare the animation name of the clicked on flower with the correct name.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Thu Jul 19, 2012 7:54 pm

Uhh.. nice idea.. Thanx a lot

I guess that might be how card-games are made too.. :-)

Anyway, that seems to work if I only have the one FlowerObject on my layout.. But if I have two copies of it, then it counts as both right AND wrong, as the animation number in one instance is correct and in the other is false..


B
5
Posts: 37
Reputation: 840

Post » Thu Jul 19, 2012 8:10 pm

@engberg: for cards you can find some implementation in this tutorial.

As for ramones example here is some implementation.

So no, you definitely haven't hit a C2's limit yet ^^
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu Jul 19, 2012 8:31 pm

Kyatric>> I'd just love to take a loot at your .capx, but is says that your version is newer than mine r99 and r95 - so I can't open it..

I've put my version up here

(and the limit-comment was merely a provocation to get help - and it worked!)engberg2012-07-19 20:35:51
B
5
Posts: 37
Reputation: 840

Post » Thu Jul 19, 2012 8:51 pm

If you have 7zip, download Kya's project and right click it and use 7-zip to "open archive".

Then, rightclick the caproj file and select Edit.

See where it says:
"<saved-with-version>9900</saved-with-version>" ?

Change 9900 to 9500.
Zelda Gamekit (my project)

Example capxs I have made:
Zelda-Style Inventory
Zelda Hearts System

The unwritten "How do I" capx etiquette! Nearly always provide a capx of the problem you have, and try to isolate the problem and/or no capx above 10 MB. :)
B
38
S
19
G
26
Posts: 438
Reputation: 16,581

Post » Thu Jul 19, 2012 8:57 pm

LaDestitute>> Now that was a handy trick! :-)

So I see that I have to create animations with a name for each flower.. Bummer for lots of flowers..

But I guess I'll try this route..
B
5
Posts: 37
Reputation: 840

Post » Thu Jul 19, 2012 9:16 pm

@engberg
Be careful with the trick LaDestitute showed you! If the r99 version had used any features that were not in r95, you could break your project. Don't use this trick if you have anything to lose.

r99 is a beta release, you can download it from the releases page, check the link on the bottom of the front page to download. (or the link in my signature)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Jul 19, 2012 9:30 pm

Alright.. Thanx.

Bonus info: I actually just bought the full version in the belief that I would get the r99-version that way round, before @LaDestitute gave the tip :-)
B
5
Posts: 37
Reputation: 840

Post » Thu Jul 19, 2012 9:48 pm

So..

I don't get what the blank sub-event does in the example from @Kyatric

It works, but I don't get why the blank events are necessary..

I'm funny that way :-)
B
5
Posts: 37
Reputation: 840

Next

Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Axiomaltd, MACPK, nicklowkcmagic, OddConfection, radbrothers and 24 guests