From: Ingo Ruhnke Date: Thu, 25 Mar 2004 11:07:02 +0000 (+0000) Subject: - fixed badguys a little bit X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e3487e5e50db8084f433860cc57205bdfae8dd65;p=supertux.git - fixed badguys a little bit SVN-Revision: 357 --- diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 36c147a75..399671f17 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -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(current_level.dn_tiles[y][x] - '0')); - current_level.dn_tiles[y][x] = 0; + add_bad_guy(x * 32, y * 32, + static_cast(current_level.ia_tiles[y][x] - 1000)); + current_level.ia_tiles[y][x] = 0; } } } diff --git a/src/level.cpp b/src/level.cpp index a32275c1d..cc40d46db 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -303,13 +303,13 @@ int level_load(st_level* plevel, const char* filename) { std::map 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; diff --git a/src/player.cpp b/src/player.cpp index b40e09365..b7edfe9de 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -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(¤t_level,base.x,base.y - 1, TM_IA, 'a'); + level_change(¤t_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(¤t_level,base.x+ 31, base.y, TM_IA, 'a'); + level_change(¤t_level,base.x+ 31, base.y, TM_IA, tile2->next_tile); play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); score = score + SCORE_DISTRO; diff --git a/src/tile.cpp b/src/tile.cpp index 1140da7e5..50ccb66fd 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -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::iterator it = tile->filenames.begin();