# Ending a game

**URL:** <https://forum.kirupa.com/t/ending-a-game/189261>\
**Category:** Uncategorized\
**Created:** [June 1, 2006, 8:08am UTC](https://forum.kirupa.com/t/ending-a-game/189261 "2006-06-01T08:08:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paida](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@Paida](https://forum.kirupa.com/u/Paida)\
**Post date:** [June 1, 2006, 8:08am UTC](https://forum.kirupa.com/t/ending-a-game/189261/1 "2006-06-01T08:08:40Z")

</div>

I am trying to end a game but couldn’t how can i end it with a loss when one gets to -10000 and a win when one gets to 10000?  
the following code is an example of how i was doing it…

if(this.hitTest(this.\_parent.bug2)) {  
this.\_parent.total=this.\_parent.total-30;  
}  
}  
if(this.hitTest(this.\_parent.bug1)) {  
this.\_parent.total=this.\_parent.total+250;  
}  
if(this.hitTest(this.\_parent.bug3)) {  
this.\_parent.total=this.\_parent.total-40;  
}

🙂  
// now i want the game to end  
//a win=10000 points  
//a loss=-10000 points  
//how can i present this  
}
