X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=79d917d6934020d551e6387a90e0b4cf203fdf5d;hb=a4bf969413cdda68ab8bb54a2a1181bdc09cf63a;hp=a48ad78bad3944432795406b1fae03677445dbe4;hpb=3dc317d10b44cc6b75db10ac194966ad8114d390;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index a48ad78b..79d917d6 100644 --- a/src/game.c +++ b/src/game.c @@ -24,12 +24,15 @@ #include "network.h" #ifdef DEBUG +#if 0 static unsigned int getStateCheckSum(int counter) { int x, y; unsigned int mult = 1; unsigned int checksum = 0; + /* static short lastFeld[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; + */ static boolean first_game = TRUE; for (y=0; yscore > highscore[k].Score) { - /* Spieler kommt in Highscore-Liste */ + /* player has made it to the hall of fame */ if (k < MAX_SCORE_ENTRIES - 1) { @@ -641,7 +645,7 @@ boolean NewHiScore() for (l=k; l=TILEX) /* Zielfeld erreicht */ + if (ABS(MovPos[x][y])>=TILEX) /* object reached its destination */ { Feld[x][y] = EL_LEERRAUM; Feld[newx][newy] = element; @@ -2148,7 +2153,7 @@ void ContinueMoving(int x, int y) Stop[newx][newy] = TRUE; JustHit[x][newy] = 3; - if (DONT_TOUCH(element)) /* Käfer oder Flieger */ + if (DONT_TOUCH(element)) /* object may be nasty to player or others */ { TestIfBadThingHitsHero(newx, newy); TestIfBadThingHitsFriend(newx, newy); @@ -2161,7 +2166,7 @@ void ContinueMoving(int x, int y) (newy == lev_fieldy-1 || !IS_FREE(x, newy+1))) Impact(x, newy); } - else /* noch in Bewegung */ + else /* still moving on */ DrawLevelField(x, y); } @@ -2305,7 +2310,7 @@ void AmoebeWaechst(int x, int y) static long sound_delay = 0; static int sound_delay_value = 0; - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* start new growing cycle */ { MovDelay[x][y] = 7; @@ -2316,7 +2321,7 @@ void AmoebeWaechst(int x, int y) } } - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before growing bigger */ { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) @@ -2351,17 +2356,17 @@ void AmoebeAbleger(int ax, int ay) return; } - if (!MovDelay[ax][ay]) /* neue Amoebe / noch nicht gewartet */ + if (!MovDelay[ax][ay]) /* start making new amoeba field */ MovDelay[ax][ay] = RND(FRAMES_PER_SECOND * 25/(1+level.tempo_amoebe)); - if (MovDelay[ax][ay]) /* neue Amoebe / in Wartezustand */ + if (MovDelay[ax][ay]) /* wait some time before making new amoeba */ { MovDelay[ax][ay]--; if (MovDelay[ax][ay]) return; } - if (element == EL_AMOEBE_NASS) /* tropfende Amöbe */ + if (element == EL_AMOEBE_NASS) /* object is an acid / amoeba drop */ { int start = RND(4); int x = ax+xy[start][0]; @@ -2380,7 +2385,7 @@ void AmoebeAbleger(int ax, int ay) if (newax == ax && neway == ay) return; } - else /* normale oder "gefüllte" Amöbe */ + else /* normal or "filled" amoeba */ { int start = RND(4); boolean waiting_for_player = FALSE; @@ -2413,7 +2418,7 @@ void AmoebeAbleger(int ax, int ay) DrawLevelField(ax, ay); AmoebaCnt[AmoebaNr[ax][ay]]--; - if (AmoebaCnt[AmoebaNr[ax][ay]]<=0) /* Amöbe vollständig tot */ + if (AmoebaCnt[AmoebaNr[ax][ay]]<=0) /* amoeba is completely dead */ { if (element == EL_AMOEBE_VOLL) AmoebeUmwandeln(ax, ay); @@ -2463,17 +2468,17 @@ void AmoebeAbleger(int ax, int ay) void Life(int ax, int ay) { int x1, y1, x2, y2; - static int life[4] = { 2, 3, 3, 3 }; /* "Life"-Parameter */ + static int life[4] = { 2, 3, 3, 3 }; /* parameters for "game of life" */ int life_time = 40; int element = Feld[ax][ay]; if (Stop[ax][ay]) return; - if (!MovDelay[ax][ay]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[ax][ay]) /* start new "game of life" cycle */ MovDelay[ax][ay] = life_time; - if (MovDelay[ax][ay]) /* neue Phase / in Wartezustand */ + if (MovDelay[ax][ay]) /* wait some time before next cycle */ { MovDelay[ax][ay]--; if (MovDelay[ax][ay]) @@ -2502,7 +2507,7 @@ void Life(int ax, int ay) nachbarn++; } - if (xx == ax && yy == ay) /* mittleres Feld mit Amoebe */ + if (xx == ax && yy == ay) /* field in the middle */ { if (nachbarnlife[1]) { @@ -2513,7 +2518,7 @@ void Life(int ax, int ay) } } else if (IS_FREE(xx, yy) || Feld[xx][yy] == EL_ERDREICH) - { /* Randfeld ohne Amoebe */ + { /* free border field */ if (nachbarn>=life[2] && nachbarn<=life[3]) { Feld[xx][yy] = element; @@ -2528,10 +2533,10 @@ void Life(int ax, int ay) void Ablenk(int x, int y) { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = level.dauer_ablenk * FRAMES_PER_SECOND; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; if (MovDelay[x][y]) @@ -2552,10 +2557,10 @@ void Ablenk(int x, int y) void Birne(int x, int y) { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 800; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; if (MovDelay[x][y]) @@ -2589,10 +2594,10 @@ void Blubber(int x, int y) void NussKnacken(int x, int y) { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 7; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) @@ -2634,10 +2639,10 @@ void AusgangstuerOeffnen(int x, int y) { int delay = 6; - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 5*delay; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { int tuer; @@ -2668,10 +2673,10 @@ void EdelsteinFunkeln(int x, int y) DrawGraphicAnimation(x, y, GFX_EDELSTEIN_BD, 4, 4, ANIM_REVERSE); else { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 11 * !SimpleRND(500); - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; @@ -2709,10 +2714,10 @@ void MauerWaechst(int x, int y) { int delay = 6; - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 3*delay; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { int phase; @@ -2764,10 +2769,10 @@ void MauerAbleger(int ax, int ay) boolean oben_massiv = FALSE, unten_massiv = FALSE; boolean links_massiv = FALSE, rechts_massiv = FALSE; - if (!MovDelay[ax][ay]) /* neue Mauer / noch nicht gewartet */ + if (!MovDelay[ax][ay]) /* start building new wall */ MovDelay[ax][ay] = 6; - if (MovDelay[ax][ay]) /* neue Mauer / in Wartezustand */ + if (MovDelay[ax][ay]) /* wait some time before building new wall */ { MovDelay[ax][ay]--; if (MovDelay[ax][ay]) @@ -3093,6 +3098,7 @@ void GameActions() #ifdef DEBUG + /* if (TimeFrames == 0 && !local_player->gone) { extern unsigned int last_RND(); @@ -3102,13 +3108,16 @@ void GameActions() last_RND(), getStateCheckSum(level.time - TimeLeft)); } + */ #endif #ifdef DEBUG + /* if (GameFrameDelay >= 500) printf("FrameCounter == %d\n", FrameCounter); + */ #endif @@ -3517,7 +3526,7 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) else if (old_jx == jx && old_jy != jy) player->MovDir = (old_jy < jy ? MV_DOWN : MV_UP); - DrawLevelField(jx, jy); /* für "ErdreichAnbroeckeln()" */ + DrawLevelField(jx, jy); /* for "ErdreichAnbroeckeln()" */ player->last_move_dir = player->MovDir; } @@ -3970,7 +3979,7 @@ int DigField(struct PlayerInfo *player, case EL_AUSGANG_ZU: case EL_AUSGANG_ACT: - /* Tür ist (noch) nicht offen! */ + /* door is not (yet) open */ return MF_NO_ACTION; break;