[Super-tux-commit] supertux/src badguy.cpp,1.128,1.129 leveleditor.cpp,1.159,1.160
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-10-19 16:28:01
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20427/src Modified Files: badguy.cpp leveleditor.cpp Log Message: Bugfix: enemies ordinary pictures were not being displayed in the leveleditor's selection bar. Bugfix: removed Bomb badguy from selection bar. Also, changed in badguy's when activate() happens: <= 0... Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.128 retrieving revision 1.129 diff -u -d -r1.128 -r1.129 --- badguy.cpp 19 Oct 2004 12:27:51 -0000 1.128 +++ badguy.cpp 19 Oct 2004 16:27:49 -0000 1.129 @@ -199,8 +199,8 @@ activate(LEFT); } } } else { - if(start_position.x > 0 && start_position.x <= screen->w - && start_position.y > 0 && start_position.y <= screen->h) + if(start_position.x >= 0 && start_position.x < screen->w + && start_position.y >= 0 && start_position.y < screen->h) activate(LEFT); } } @@ -284,6 +284,21 @@ Surface* BadGuy::get_image() { +// Set action as the "default" one. +specs->sprite->set_action("left"); +if(BAD_JUMPY) + specs->sprite->set_action("left-up"); +else if(kind == BAD_BOMB) + specs->sprite->set_action("ticking-left"); +else if(kind == BAD_FLAME) + specs->sprite->set_action("normal"); +else if(kind == BAD_STALACTITE) + specs->sprite->set_action("normal"); +else if(kind == BAD_FISH) + specs->sprite->set_action("normal"); +else if(kind == BAD_FLAMEFISH) + specs->sprite->set_action("normal"); + return specs->sprite->get_frame(0); } Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.159 retrieving revision 1.160 diff -u -d -r1.159 -r1.160 --- leveleditor.cpp 18 Oct 2004 20:42:11 -0000 1.159 +++ leveleditor.cpp 19 Oct 2004 16:27:50 -0000 1.160 @@ -126,9 +126,13 @@ } for(int i = 0; i < NUM_BadGuyKinds; i++) { + // filter bomb, since it is only for internal use, not for levels + if(i == BAD_BOMB) + continue; + BadGuyKind kind = BadGuyKind(i); BadGuy badguy(kind, 0,0); - badguy.activate(LEFT); +// badguy.activate(LEFT); Surface *img = badguy.get_image(); tiles_board->add_button(Button(img, "", SDLKey(SDLK_1+i)), -(i+1)); @@ -619,7 +623,7 @@ { BadGuyKind kind = BadGuyKind((-id)-1); BadGuy badguy(kind, 0,0); - badguy.activate(LEFT); +// badguy.activate(LEFT); Surface *img = badguy.get_image(); context.draw_surface(img, Vector(event.button.x - 8, @@ -782,8 +786,8 @@ for(Sector::GameObjects::iterator i = sector->gameobjects.begin(); i != sector->gameobjects.end(); i++) { BadGuy* badguy = dynamic_cast<BadGuy*> (*i); - if(badguy) - badguy->activate(LEFT); +// if(badguy) +// badguy->activate(LEFT); TileMap* tilemap = dynamic_cast<TileMap*> (*i); if(tilemap) |