A little help needed: Values?

For questions about using Classic.

Post » Fri Oct 03, 2008 2:57 am

Gday,
I'm kinda new Construct but I've been reading up on tuts and the wiki to get me this far.

I've been making a simple LEGO based game where you control a little LEGO duck.



Click [url:3ibvguz3]http://jaeuploads.googlepages.com/DUCKthumb.jpg[/url:3ibvguz3] for a larger image, I couldn't workout how to make thumbs nails in here (tying to keep things clean)

The Aim of the game is to collect coins and eat pizza (to pass the level)

What I'm trying to do is when you collect a X amount of coins something happens, in this case the hat appears and you can put it on, granting you more jump power so you can get to the pizza and pass the level.
But the problemo is that I can't figure out how these values work; to make them trigger something, how to make a text object display those numbers and if I can use the same coin object multiple times ... or if I should even be using values at that.

Here's my... events, this is where I'm most likely wrong in many cases, for I don't really know what I'm doing and things are all over the place.


[url:3ibvguz3]http://jaeuploads.googlepages.com/DUCKevents001.jpg[/url:3ibvguz3]

(The rotating of the DUCK I found out myself, though indeed it's not the best method but it's the only one I could think of, maybe that's another thing I could learn)

I've made quite a few mini games with Construct but nothing too complex because this is where I get stuck.

So could anyone kindly help me? :) I know It would have to be a simple thing but I'm stuck.
B
1
G
4
Posts: 5
Reputation: 1,035

Post » Fri Oct 03, 2008 5:16 am

Set Private Variable ('cointotal') for other object (for example Text Object, but not Coin). Increment it when collision with coin (instead of Coin: add 1 to cointotal, you should make Text: add 1 to cointotal).
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Fri Oct 03, 2008 6:01 am

Ah! thank you very much, got the coin amount working. :)
Would you also know how to make something change once it gets to a number?

As once you collect 5 coins the hat will magically appear (set visible + collision on)
I can't see any "if/on value" things D:
B
1
G
4
Posts: 5
Reputation: 1,035

Post » Fri Oct 03, 2008 7:38 am

[quote="Jae":39lokngo]Ah! thank you very much, got the coin amount working. :)
Would you also know how to make something change once it gets to a number?

As once you collect 5 coins the hat will magically appear (set visible + collision on)
I can't see any "if/on value" things D:[/quote:39lokngo]

[code:39lokngo]
+CoinCounter.Value('CoinTotal') Equal to 5
-Hat: Make Visible

+Duck is Overlapping Hat
+Hat is visible
-Duck: Change Animation to "DuckWearingAHat"
-Duck: Platform: Set Jump Strength to 9999
-Hat: Destroy
[/code:39lokngo]

You get to the "Value Equal to" condition by selecting "Compare a private variable" in the conditions list. It's highlighted in yellow, you can't miss it.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Oct 03, 2008 8:15 am

I couldn't figure out how to do that, the "Compare a private variable" event shows up only on a sprite object, not the text one. :( unless I'm ment to do something else.

But with mucking around for a while trying to find out why I found the simple [Text is "X"] event seems to work for me just fine, but maybe for later games when things get technical this method mightn't work?

B
1
G
4
Posts: 5
Reputation: 1,035

Post » Fri Oct 03, 2008 9:11 am

That's odd. "Compare private variable" shows up for text objects for me :?

But hey, if it works, it works :)

Edit:
Hmm, seems I gave you a little misinformation previously. "Compare private variable" is highlighted for sprite objects, but not text objects. It should still be in the list, though.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Oct 03, 2008 10:47 am

Ah haha, I see it now :)
Thanks for your help. If I come across any more problems I'll be sure to ask.

Here's the current project so far if anyone wanted to see it. Nothing much at it's current state but there's a few test levels (the bonus level isn't finished and the clouds are just test ones)

[url:2yz7foih]http://jaeuploads.googlepages.com/D.U.C.Kv5beta.zip[/url:2yz7foih]

Here's some pictures,







B
1
G
4
Posts: 5
Reputation: 1,035


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests