How do I count up/down using lerp?

Get help using Construct 2

Post » Sat Jul 05, 2014 4:17 pm

I found this, and this seems to do what I need it to do, however, there are decimals and I needed to count up a bit faster. I tried adding a int() and floor() but the value never reach the max count. Basically I want to count up to whatever the max value is in a certain time, like within 100ticks. Oh, and I don't need to slow down, though that's optional.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Sat Jul 05, 2014 4:37 pm

Use round(). int & floor always round down.
ImageImageImage
B
71
S
21
G
222
Posts: 3,652
Reputation: 124,733

Post » Sat Jul 05, 2014 6:57 pm

animated-text-score-board_p672016?#p672016

There's an example of counting up to a valuein x seconds. I suppose you could use the timer behavior now.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Sun Jul 06, 2014 11:56 pm

Btw, I suppose I cause lerp to cause the slow rotation of a spin wheel, like say, a roulette wheel?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Jul 08, 2014 10:54 am

ramones wrote:https://www.scirra.com/forum/animated-text-score-board_p672016?#p672016

There's an example of counting up to a valuein x seconds. I suppose you could use the timer behavior now.


That's what I pretty much need, but I it to add, it only seems to set the value.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Jul 08, 2014 2:14 pm

I put the adding & subtracting in a group. When the group is active it does the counting. Mind the values "are not equal". Figure it out:
Image
My game Petrolhead Tactics is now on Steam Greenlight. I could not have done this without C2 ? Please rate, if you like!

Steam client already open: petrolheadtactics.com/steam
Web: petrolheadtactics.com/greenlight
B
20
S
4
G
4
Posts: 132
Reputation: 4,130

Post » Tue Jul 08, 2014 2:39 pm

Hmm, well, that wouldn't add "X" amount in a certain amount of time, would it?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Jul 08, 2014 2:54 pm

Azu wrote:Hmm, well, that wouldn't add "X" amount in a certain amount of time, would it?


Not quite a tailored solution for you. I thought with every x second instead of every tick it might have been something. Sometimes it only takes half the way to see where you are going ;)
My game Petrolhead Tactics is now on Steam Greenlight. I could not have done this without C2 ? Please rate, if you like!

Steam client already open: petrolheadtactics.com/steam
Web: petrolheadtactics.com/greenlight
B
20
S
4
G
4
Posts: 132
Reputation: 4,130

Post » Wed Jul 09, 2014 4:12 am

I haven't the foggiest idea of what you just said.
"Sometimes it only takes half the way to see where you are going "
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Wed Jul 09, 2014 7:49 am

Programing is all about creativity, man!
My game Petrolhead Tactics is now on Steam Greenlight. I could not have done this without C2 ? Please rate, if you like!

Steam client already open: petrolheadtactics.com/steam
Web: petrolheadtactics.com/greenlight
B
20
S
4
G
4
Posts: 132
Reputation: 4,130


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests