Game over when score=

Hi,
I took this code from an open source pong game, but it lacks a ‘game over’ scene when player(spieler) or opponent (gegener) reaches a certain amount of points. And that is exactly what I would like to add. I would think I could add something like:

function spielerwins ()
{
if(spieler_score >= 15)
gotoAndPlay(2);
}

where frame 2 on the main timeline is a movieclip saying something like: game over, you won.

This is the code from the open source, placed on frame 1 of the main timeline:

stop();
var spieler_score = 0;
var gegner_score = 0;

loseSnd = new Sound();
loseSnd.attachSound(“lose”);

bounceSnd = new Sound();
bounceSnd.attachSound(“bounce”);

// Schwierigkeitsgrad (je grösser der Wert desto Leichter)
skill = 4;

// Spieler (Init)
spielerInitObj = new Object();
spielerInitObj._x = 385;
spielerInitObj._y = 150;
spielerInitObj.onEnterFrame = steuer_spieler;

// Computergegner (Init)
gegnerInitObj = new Object();
gegnerInitObj._x = 15;
gegnerInitObj._y = 150;
gegnerInitObj.onEnterFrame = steuer_gegner;

// Spielball (Init)
ballInitObj = new Object();
ballInitObj._x = 200;
ballInitObj._y = 150;
ballInitObj.vx = 5;
ballInitObj.vy = 0;
ballInitObj.onEnterFrame = steuer_ball;

// Spieler, Gegner und Ball auf die Bühne setzen
_root.attachMovie(“rect”,“spieler”,0,spielerInitObj);
_root.attachMovie(“edwin2”,“gegner”,1,gegnerInitObj);
_root.attachMovie(“ball”,“ball_mc”,2,ballInitObj);

// Spielersteuerung
function steuer_spieler() {
if(_root._ymouse > this._height/2 && _root._ymouse < 300 - this._height/2) this._y = _root._ymouse;
}

// Computergegnersteuerung
function steuer_gegner() {
this.dy = this._y - ball_mc._y;
this._y -= this.dy / skill;
}

// Ballsteuerung
function steuer_ball() {
// Mittelpunkt des Spielballs
if(this._y > 300 - this._height / 2) this.vy *= -1;
if(this._y < 0 + this._height / 2) this.vy *= -1;

// Spieler (verliert den Ball)
if(this._x > 400) {
loseSnd.start();
gegner_score += 1;
this._x = 200;
this._y = 150;
this.vx = -5;
this.vy = 0;
}

// Computergegner (verliert den Ball)
if(this._x < 0) {
loseSnd.start();
spieler_score += 1;
this._x = 200;
this._y = 150;
this.vx = 5;
this.vy = 0;
}

// Spieler (Hoch/Runter)
spieler_up_y = spieler._y - spieler._height / 2;
spieler_bottom_y = spieler._y + spieler._height / 2;

// Computergegner (Hoch/Runter)
gegner_up_y = gegner._y - gegner._height / 2;
gegner_bottom_y = gegner._y + gegner._height / 2;

// Spieler (Bewegungraum festlegen)
// Ball-Bewegungsrichtung umkehren
if(this._x > (385 - spieler._width / 2) && this._y > spieler_up_y && this._y < spieler_bottom_y) {
bounceSnd.start();
this.vx *= -1;
this.vy = (this._y - spieler._y) * .8;
}

// Computergegner (Bewegungsraum festlegen)
// Ball-Bewegungsrichtung umkehren
if(this._x < (15 + gegner._width / 2) && this._y > gegner_up_y && this._y < gegner_bottom_y) {
bounceSnd.start();
this.vx *= -1;
this.vy = (this._y - gegner._y) * .8;
}

// Ballbewegung (Umsetzen)
this._x += this.vx;
this._y += this.vy;

// Ballgeschwindigkeit um den Faktor 1.0001 erhöhen
this.vx *= 1.0010;
this.vy *= 1.0001;
}

Could someone tell me how I should do this?I am sorry it is in german, but that’s the source!

Thank you very much again,
Jerryj.