# onEnterFrame/hitTest - game scoring

**URL:** https://forum.kirupa.com/t/onenterframe-hittest-game-scoring/188834
**Category:** flash
**Created:** [May 11, 2006, 6:33am UTC](https://forum.kirupa.com/t/onenterframe-hittest-game-scoring/188834 "2006-05-11T06:33:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sfumato](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sfumato](https://forum.kirupa.com/u/sfumato)
#### Post date: [May 11, 2006, 6:33am UTC](https://forum.kirupa.com/t/onenterframe-hittest-game-scoring/188834/1 "2006-05-11T06:33:39Z")

</div>

I am designing a game for a client that is very basic. A kayaker will kayak down the river avoiding rocks and other objects. For each second he paddles, he receives a point. When he hits an object points stop, as does the river’s motion, until the user moves the kayaker from the object.

I have everything figured out except I want the game to be over after the user has crashed 5 times. I have a countdown counter (bottom left corner) built, but when the kayak collides with another object, the counter begins rapidly decreasing. I believe this is because it is looping with the \*onEnterFrame \*method, but I do not know how to make it just decrease by one (1) each time there is a collision. I have tried deleting the \*onEnterFrame \*when a collision happens, but I do not know how to get the function back after the kayak moves away from the object.

I hope this makes sense.

The SWF can be seen here:

[http://www.bullpencatcher.com/rivergame3.swf](http://www.bullpencatcher.com/rivergame3.swf)

And my FLA can be downloaded here:

[http://www.bullpencatcher.com/rivergame3.fla](http://www.bullpencatcher.com/rivergame3.fla)

The game is very basic right now with only one object and the banks of the river that will stop the flow and cause the countdown to start. Use the left and right arrows to steer.

Any advice you could give would be greatly appreciated. Let me know if you need more info.

Bryan
