Compare Score over Time?

Get help using Construct 2

Post » Sun Apr 29, 2012 8:33 pm

I have the score updating as a text string fine, but I'd also like to add another score indicator that compares the score to the previous tick's score. So if the score goes down from the previous tick, a frown face appears. If the score goes up from the previous tick, a happy face appears.
Is there a type of "pick nth instance" for a time-based variable (instead of just objects) for this type of comparison?

Thanks!

Norm
B
4
G
1
Posts: 7
Reputation: 743

Post » Sun Apr 29, 2012 9:37 pm

Just use another variable.

Consider two globals : Score and oldScore

On start of the tick (so on top of your event sheet) set the value of oldScore to the value of Score.
Then during the event sheet, there may or may not be changes to Score's value.

At the bottom of the event sheet have events
OldScore < (less than) Score => Show Happy face
OldScore > Score => Show Frown face
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Mon Apr 30, 2012 3:31 am

Much Thanks! I had played around with two globals, but forgot to take into enough account the hierarchy of the event sheet. By moving the global comparisons lower in the sheet like you suggested, and adding a delay ("wait") of 1.5 seconds to accommodate the rapid scoring events that call up the positive indicator, I got exactly what I wanted.

Thanks again!

Norm

B
4
G
1
Posts: 7
Reputation: 743


Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble, imnotspecial and 21 guests