# U3L16 - Collision score - limiting to +1

**URL:** <https://forum.code.org/t/u3l16-collision-score-limiting-to-1/13766>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3, csd-unit-3-lesson-16\
**Created:** [January 18, 2018, 10:21pm UTC](https://forum.code.org/t/u3l16-collision-score-limiting-to-1/13766 "2018-01-18T22:21:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![josh](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/josh/32/868_2.png) [@josh](https://forum.code.org/u/josh)\
**Post date:** [February 20, 2018, 5:34am UTC](https://forum.code.org/t/u3l16-collision-score-limiting-to-1/13766/4 "2018-02-20T05:34:31Z")

</div>

A few ways that I’ve seen students deal with this issue:

- Move the sprite to a new location as soon as they touch
- Use a boolean variable to track if a sprite has been touched
- Use a coutdown/countup variable that gets reset when sprites touch eg:

```javascript
var countdown = 0;
var score = 0;
draw() {
    // If the countdown hasn't finished, keep counting down
    if (countdown > 0) {
        countdown = countdown - 1;
    }

    if (sprite1.isTouching(sprite2)) {
        // Check if the countdown timer is active before scoring
        if (countdown == 0) {
            score = score + 1;

            // Start the countdown timer to prevent another score
            countdown = 10;
        }
    }
}

```

---

_[View the full topic](https://forum.code.org/t/u3l16-collision-score-limiting-to-1/13766)._
