# Score function

**URL:** <https://forum.kirupa.com/t/score-function/288409>\
**Category:** flash\
**Created:** [May 15, 2009, 11:44am UTC](https://forum.kirupa.com/t/score-function/288409 "2009-05-15T11:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martendeman](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Martendeman](https://forum.kirupa.com/u/Martendeman)\
**Post date:** [May 15, 2009, 11:44am UTC](https://forum.kirupa.com/t/score-function/288409/1 "2009-05-15T11:44:14Z")

</div>

Hello All,  
I made a little game like brick breaker.  
Now i get 20 points for evry brick i break, and there will be 100 points taken when it hits the bottom.  
so when i break 2 bricks i have 40 points, but if i lose a ball by hitting the bottom the score is going to be -60.  
How do i prevent this wil become a number below 0, so it will go from 40 to 0 in stead of -60.

Many thanks
