- fixed badguys a little bit
authorIngo Ruhnke <grumbel@gmx.de>
Thu, 25 Mar 2004 11:07:02 +0000 (11:07 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Thu, 25 Mar 2004 11:07:02 +0000 (11:07 +0000)
SVN-Revision: 357

src/gameloop.cpp
src/level.cpp
src/player.cpp
src/tile.cpp

index 36c147a..399671f 100644 (file)
@@ -103,15 +103,15 @@ void activate_bad_guys(void)
   int x,y;
 
   /* Activate bad guys: */
-
   for (y = 0; y < 15; y++)
     {
       for (x = 0; x < current_level.width; x++)
         {
-          if (current_level.dn_tiles[y][x] >= '0' && current_level.dn_tiles[y][x] <= '9')
+          if (current_level.ia_tiles[y][x] >= 1000 && current_level.ia_tiles[y][x] <= 1010)
             {
-              add_bad_guy(x * 32, y * 32,  static_cast<BadGuyKind>(current_level.dn_tiles[y][x] - '0'));
-              current_level.dn_tiles[y][x] = 0;
+              add_bad_guy(x * 32, y * 32,  
+                          static_cast<BadGuyKind>(current_level.ia_tiles[y][x] - 1000));
+              current_level.ia_tiles[y][x] = 0;
             }
         }
     }
index a32275c..cc40d46 100644 (file)
@@ -303,13 +303,13 @@ int level_load(st_level* plevel, const char* filename)
         {
           std::map<char, int> transtable;
           transtable['.'] = 0;
-          transtable['0'] = 0;
-          transtable['1'] = 1;
-          transtable['2'] = 2;
-          transtable['x'] = 77;
+          transtable['0'] = 1000;
+          transtable['1'] = 1001;
+          transtable['2'] = 1002;
+          transtable['x'] = 104;
           transtable['X'] = 77;
           transtable['y'] = 78;
-          transtable['Y'] = 78;
+          transtable['Y'] = 105;
           transtable['A'] = 83;
           transtable['B'] = 102;
           transtable['!'] = 103;
index b40e093..b7edfe9 100644 (file)
@@ -173,8 +173,6 @@ Player::action()
 
   if (!dying)
     {
-
-
       if( !on_ground())
         {
           if(under_solid())
@@ -243,9 +241,10 @@ Player::action()
 
           if(size == SMALL)
             {
+              Tile* tile  = gettile(base.x, base.y);
+              Tile* tile2 = gettile(base.x + 31, base.y);
               /* Get a distro from a brick? */
-              if (gettile(base.x, base.y)->brick ||
-                  gettile(base.x, base.y)->brick)
+              if (tile->brick)
                 {
                   add_bouncy_distro((((int)base.x)
                                      / 32) * 32,
@@ -257,15 +256,14 @@ Player::action()
                     }
 
                   if (distro_counter <= 0)
-                    level_change(&current_level,base.x,base.y - 1, TM_IA, 'a');
+                    level_change(&current_level,base.x,base.y - 1, TM_IA, tile->next_tile);
                    
                   play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER);
                   score = score + SCORE_DISTRO;
                   distros++;
                 }
-              else if (gettile(base.x+ 31, base.y)->brick ||
-                       gettile(base.x+ 31, base.y)->brick)
-                {
+              else if (tile2->brick)
+              {
                   add_bouncy_distro((((int)base.x + 31)
                                      / 32) * 32,
                                     ((int)base.y / 32) * 32);
@@ -276,7 +274,7 @@ Player::action()
                     }
 
                   if (distro_counter <= 0)
-                    level_change(&current_level,base.x+ 31, base.y, TM_IA, 'a');
+                    level_change(&current_level,base.x+ 31, base.y, TM_IA, tile2->next_tile);
 
                   play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER);
                   score = score + SCORE_DISTRO;
index 1140da7..50ccb66 100644 (file)
@@ -53,16 +53,16 @@ void TileManager::load_tileset(std::string filename)
   
               LispReader reader(lisp_cdr(element));
               assert(reader.read_int("id",  &tile->id));
-              reader.read_bool("solid", &tile->solid);
-              reader.read_bool("brick", &tile->brick);
-              reader.read_bool("ice", &tile->ice);        
-              reader.read_bool("fullbox", &tile->fullbox);
-              reader.read_bool("distro", &tile->distro);
-              reader.read_int("data",  (int*)&tile->data);
-              reader.read_int("alpha",  (int*)&tile->alpha);
-              reader.read_int("anim-speed",  &tile->anim_speed);
+              reader.read_bool("solid",     &tile->solid);
+              reader.read_bool("brick",     &tile->brick);
+              reader.read_bool("ice",       &tile->ice);          
+              reader.read_bool("fullbox",   &tile->fullbox);
+              reader.read_bool("distro",    &tile->distro);
+              reader.read_int("data",       (int*)&tile->data);
+              reader.read_int("alpha",      (int*)&tile->alpha);
+              reader.read_int("anim-speed", &tile->anim_speed);
               reader.read_int("next-tile",  &tile->next_tile);
-              reader.read_int("next-tile2",  &tile->next_tile2);
+              reader.read_int("next-tile2", &tile->next_tile2);
               reader.read_string_vector("images",  &tile->filenames);
 
              for(std::vector<std::string>::iterator it = tile->filenames.begin();