[Super-tux-commit] supertux/src gameloop.cpp,1.26,1.27 level.cpp,1.14,1.15 player.cpp,1.13,1.14 tile
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-03-25 11:18:04
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4821 Modified Files: gameloop.cpp level.cpp player.cpp tile.cpp Log Message: - fixed badguys a little bit Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- player.cpp 25 Mar 2004 02:27:45 -0000 1.13 +++ player.cpp 25 Mar 2004 11:07:02 -0000 1.14 @@ -173,8 +173,6 @@ if (!dying) { - - if( !on_ground()) { if(under_solid()) @@ -243,9 +241,10 @@ 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 @@ } 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 @@ } 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; Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- level.cpp 25 Mar 2004 10:26:07 -0000 1.14 +++ level.cpp 25 Mar 2004 11:07:02 -0000 1.15 @@ -303,13 +303,13 @@ { 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: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tile.cpp 25 Mar 2004 10:26:07 -0000 1.4 +++ tile.cpp 25 Mar 2004 11:07:02 -0000 1.5 @@ -53,16 +53,16 @@ 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(); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- gameloop.cpp 25 Mar 2004 10:26:07 -0000 1.26 +++ gameloop.cpp 25 Mar 2004 11:07:02 -0000 1.27 @@ -103,15 +103,15 @@ 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; } } } |