Points going above sprites heads.

Get help using Construct 2

Post » Wed May 22, 2013 1:21 am

I am wondering if there is a way to have points fly above sprites heads as I earn them, like in super mario world for the snes. I already have my game set up to add up my score in the HUD when I stomp critters but it would just be cool to see the numbers pop up like +1!

If anyone knows how this could be set up I would love to know about it! Thanks much!
B
8
S
1
Posts: 42
Reputation: 1,159

Post » Wed May 22, 2013 1:51 am

You can make a text object and, each time you want to display points, create the text object at sprite.X and sprite.Y-(value) to put the points above your sprite. Set the value (100, 200, 300...) Then destroy the text object :)

If you want the text object move to make it more dynamic you can set the sine behavior on it.

This works with sprite instead of text object too.Lowren2013-05-22 01:53:25
B
22
S
6
G
3
Posts: 59
Reputation: 4,288

Post » Wed May 22, 2013 2:29 am

Lowren beat me to it, here is the example I just made:
https://dl.dropboxusercontent.com/u/85412219/forumposts/FloatingScore.capx

It uses behaviors to make it float away, fade out, and destroy itself.
so you just spawn it and forget it. 1 event.
B
223
S
59
G
32
Posts: 901
Reputation: 39,238

Post » Wed May 22, 2013 2:38 am

I made an example on the Arcade:



It's a function with only one event, and you can call it using any score value. You will need a custom font for it (I made one for the example) or you can change it a bit to just use text.
B
83
S
22
G
15
Posts: 1,039
Reputation: 15,219

Post » Wed May 22, 2013 5:02 am

Thanks for all the help guys. Those examples especially helped a lot!
B
8
S
1
Posts: 42
Reputation: 1,159


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, plinkie, Yahoo [Bot] and 9 guests