Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140762

How to stop a timed score when "dying"?

$
0
0

I have a score that increases with time. I did it by creating a function that contains a simple variable "x = x + 1;" and then having an interval set every 100ms. I have then set the variable to a text reference to show on the screen.

My problem is that when the player-object collides with something I want the score to stop and show how far the player got but at the moment the score just keeps going or display "NaH".


Viewing all articles
Browse latest Browse all 140762

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>