Counter effect

Get help using Construct 2

Post » Tue May 17, 2016 11:02 am

Hi, did anyone already make an effect like this image below?
Image

I would like to do something like this to count score in game over, for exemple, and finally show the players score...but have no idea how to start.

Tks,
B
11
S
3
Posts: 16
Reputation: 768

Post » Tue May 17, 2016 1:32 pm

Do you want the numbers to give impression of rolling up and down just like what you posted too?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Tue May 17, 2016 1:37 pm

TwinBlazar wrote:Do you want the numbers to give impression of rolling up and down just like what you posted too?


Yes, rolling up for a couple of seconds and finally stop in the final score...got it?

Tks for reply
B
11
S
3
Posts: 16
Reputation: 768

Post » Tue May 17, 2016 3:16 pm

One possibility:

You have to create an image for all numbers 0-9, and also create images for when the numbers are rolling. Do you want just several frames of quick speedy animation (which the player couldn't see what the number is) OR do you want to create the frames showing the gap between each number? This is all entirely up to you.

You will have a Sprite called "Digit" which has 2 animations: "stillNumber" and "rolling".

"stillNumber" will have 10 frames, frame 0 has number 0. Frame 1 has number 1. And so on until 9.

"rolling" will obviously have the frames of rolling numbers.

Create an instance variable called "index" for the Sprite Digit. Now, clone the sprite until you have 6 instances of sprite Digit. Line them up in a row just like what you posted. From the rightmost Digit to the leftmost Digit, assign a running index value starting from 0 to 5 to its variable "index". So the rightmost Digit will have "index" of 0. The second rightmost Digit will have "index" of 1. And so on, until the leftmost Digit which will have "index" of 5.

In the event sheet, you will refer to each Digit using the variable "index", using For Each (ordered). You will have to refer to the number variable you want in this loop and pick out the particular digit from such variable. You can acquire just the nth digit of an integer variable by dividing it by 10^(n-1), floor the result and do modulo operation (%) on it with value of 10. For example, getting the 3rd digit of 98765: floor(98765 / (10^2)) = 987 --> 987 % 10 = 7. Thereby, you get number 7 which is the 3rd digit of number 98765. From here, you can map these values you get with the "stillNumber" animation frames.

However, one part still remains and that is the rolling part. The paragraph above is simply for mapping number to be shown correctly, but for aesthetics of rolling number, suppose the integer variable you are referring to is changing, you could make it so the Digit changes its animation to rollingNumber for a brief moment before turning into "stillNumber" animation once again. But for this part here, how the rolling numbers should look like exactly when the referred variable change around is entirely up to you.

Follow everything so far?

-----

Above is just one possibility, and it has its own pro and con. But does this fit your bill?

Also, if anyone can come up with something simpler, please do share.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Tue May 17, 2016 3:32 pm

I followed your way of thinking, and its a nice suggestion!! I will try to make some .capx and then post to improve with some help!!

Thought anyone could have already done that...

Tks a lot!!
B
11
S
3
Posts: 16
Reputation: 768

Post » Tue May 17, 2016 4:43 pm

too much blur..but anyway...

counter.capx
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Tue May 17, 2016 9:27 pm

thats it!! its exactly what i was looking for!!

Tks a lot to everyone
B
11
S
3
Posts: 16
Reputation: 768


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests