|
@@ -58,6 +58,7 @@ void Map::reset( Text *zOptionen )
|
|
richtung = 0;
|
|
richtung = 0;
|
|
addAnzahl = 0;
|
|
addAnzahl = 0;
|
|
score = 0;
|
|
score = 0;
|
|
|
|
+ scoreCheck = score * 11197;
|
|
schlange->leeren();
|
|
schlange->leeren();
|
|
ziele->leeren();
|
|
ziele->leeren();
|
|
Text *tmp = zOptionen->getTeilText( zOptionen->positionVon( '=' ) + 1, zOptionen->positionVon( ',' ) );
|
|
Text *tmp = zOptionen->getTeilText( zOptionen->positionVon( '=' ) + 1, zOptionen->positionVon( ',' ) );
|
|
@@ -105,6 +106,7 @@ void Map::reset( Text *zOptionen )
|
|
if( br == breite && hö == höhe )
|
|
if( br == breite && hö == höhe )
|
|
{
|
|
{
|
|
save->lese( (char*)&score, 4 );
|
|
save->lese( (char*)&score, 4 );
|
|
|
|
+ scoreCheck = score * 11197;
|
|
save->lese( (char*)&richtung, 4 );
|
|
save->lese( (char*)&richtung, 4 );
|
|
int anz = 0;
|
|
int anz = 0;
|
|
save->lese( (char*)&anz, 4 );
|
|
save->lese( (char*)&anz, 4 );
|
|
@@ -266,9 +268,18 @@ bool Map::tick( double tickVal )
|
|
ziele->leeren();
|
|
ziele->leeren();
|
|
for( int i = 0; i < zAnzahl; i++ )
|
|
for( int i = 0; i < zAnzahl; i++ )
|
|
ziele->add( Pos{ (short)( rGen->rand() * breite ), (short)( rGen->rand() * höhe ) } );
|
|
ziele->add( Pos{ (short)( rGen->rand() * breite ), (short)( rGen->rand() * höhe ) } );
|
|
- if( zAnz )
|
|
|
|
- score++;
|
|
|
|
|
|
+ if( zAnz )
|
|
|
|
+ {
|
|
|
|
+ score++;
|
|
|
|
+ scoreCheck = score * 11197;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ if( score * 11197 != scoreCheck )
|
|
|
|
+ {
|
|
|
|
+ beendet = 1;
|
|
|
|
+ score = 0;
|
|
|
|
+ scoreCheck = 0;
|
|
|
|
+ }
|
|
if( !beendet )
|
|
if( !beendet )
|
|
{
|
|
{
|
|
schlange->add( Pos{ (short)nx, (short)ny }, 0 );
|
|
schlange->add( Pos{ (short)nx, (short)ny }, 0 );
|