Sprite coin counter

Get help using Construct 2

Post » Sun Aug 12, 2012 2:49 am

I've made it to where I can have it say how many coins I've collected on the top left no problem. I've read that tutorial. I was wondering if there is a way to have an image instead of the word like:

(sprite of coin image): 07

Any help is much appreciated
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Aug 12, 2012 4:44 am

just put a sprite there, where the coin should be, and put the text beside it.


If you want bitmap fonts
http://www.scirra.com/forum/plugin-spritefont-31th-july-2012_topic45876.html
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Sun Aug 12, 2012 5:06 am

Thanks man, I'll look into it here in just a minute!

While I have your attention I would like to ask another question (I've seen you answer many questions on forums).

I have no idea how create a life bar that is of hearts and how to implement it with damage taken or health gained. Can you help with that?

Thanks for answering my original question
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Aug 12, 2012 6:25 am

No problem!
So you want something like Zelda?
The kind with just 3 hearts and you remove one for every hit?

I'd suggest you use a Tiled Background Sprite with one heart sprite within it, stretch it to 3 hearts.
When you get hit, set the event to set it's width to itself with .ImageWidth and minus off eg. 20px from it?

So Life.ImageWidth - X (X being the width of each Heart sprite)

If you want to regain one, simply add it back.
Also, you should set a limit by checking if imageWidth is already maxed or 0.

Hope this helps!
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Sun Aug 12, 2012 8:13 am

Thanks a lot. Both tips worked like a charm.
Your answers are so clear and concise compared to most I get (not that I'm not thankful for them).

If it's not too much trouble I would like another question since you answer my questions so clearly.

I have falling platforms (they fall when you stand on them no problem there), but once I am on it I cannot "jump" off of them. I have to walk off. Any idea of what I should do?

Here is the capx.

https://www.dropbox.com/s/ryom0vrmfg6ry9f/Jungle%20Tutorial%20%28Hulk%29.capx
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Aug 12, 2012 9:02 am

That's a tough one..

The problem is as the platform falls, the player is not moving with the platform, its falling slower and bouncing on it. Most of the time, leaving it in the air.

Other people suggest you add a double jump to the player, and you enable double jump when you are on the platform, but disable it once you are off it.

http://www.scirra.com/forum/jumping-from-falling-objects_topic52019.html
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Sun Aug 12, 2012 9:17 am

Yeah, I saw this post, but I was trying to do it without a double jump. Is there a way I can have the double jump active when I am on the falling platforms, but then inactive when I'm not?
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Aug 12, 2012 9:48 am

I would do a distance() check, checking if your Y distance is within an acceptable range and you X distance is within the platform's width. This should almost always get you a double only when you are falling from the platform.

Use the pick nearest object to choose your platform to check distance with.
To minimize the distance range acceptable needed, remove the elasticity from the platform. I checked your capx, it'a factor making your player object bounce on it.Rory2012-08-12 09:50:58
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Tue Sep 18, 2012 7:22 am

Hey Rory, I still haven't tried this yet. I've been caught in up in a lot of things, but I will try soon and let you know. Thanks for all your help by the way. My friend and I liked your game.
B
23
S
6
G
3
Posts: 122
Reputation: 2,922


Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble, Evanetot and 25 guests