From: Ingo Ruhnke Date: Fri, 9 Apr 2004 16:26:06 +0000 (+0000) Subject: - fixed snowball anim X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=51b16156734d4f61a8a11b166ada7294a90cce4c;p=supertux.git - fixed snowball anim SVN-Revision: 439 --- diff --git a/data/images/shared/snowball-left-0.png b/data/images/shared/snowball-left-0.png index 58978e597..9e2f9ad70 100644 Binary files a/data/images/shared/snowball-left-0.png and b/data/images/shared/snowball-left-0.png differ diff --git a/data/images/shared/snowball-left-1.png b/data/images/shared/snowball-left-1.png index ad970a53b..1c9e07d1f 100644 Binary files a/data/images/shared/snowball-left-1.png and b/data/images/shared/snowball-left-1.png differ diff --git a/data/images/shared/snowball-left-2.png b/data/images/shared/snowball-left-2.png index 3044d3d86..6f8b23eec 100644 Binary files a/data/images/shared/snowball-left-2.png and b/data/images/shared/snowball-left-2.png differ diff --git a/data/images/shared/snowball-right-0.png b/data/images/shared/snowball-right-0.png index fedd829cb..5533c3131 100644 Binary files a/data/images/shared/snowball-right-0.png and b/data/images/shared/snowball-right-0.png differ diff --git a/data/images/shared/snowball-right-1.png b/data/images/shared/snowball-right-1.png index 83f241d8f..5f04bee6a 100644 Binary files a/data/images/shared/snowball-right-1.png and b/data/images/shared/snowball-right-1.png differ diff --git a/data/images/shared/snowball-right-2.png b/data/images/shared/snowball-right-2.png index b464dbf93..434924224 100644 Binary files a/data/images/shared/snowball-right-2.png and b/data/images/shared/snowball-right-2.png differ diff --git a/src/badguy.cpp b/src/badguy.cpp index 37d196813..ca16da2d6 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -48,8 +48,8 @@ texture_type img_flyingsnowball[2]; texture_type img_flyingsnowball_squished[1]; texture_type img_spiky_left[3]; texture_type img_spiky_right[3]; -texture_type img_snowball_left[3]; -texture_type img_snowball_right[3]; +texture_type img_snowball_left[4]; +texture_type img_snowball_right[4]; texture_type img_snowball_squished_left[1]; texture_type img_snowball_squished_right[1]; @@ -178,14 +178,14 @@ BadGuy::init(float x, float y, BadGuyKind kind_) set_texture(img_fish, img_fish, 2, 1); physic.enable_gravity(true); } else if(kind == BAD_FLYINGSNOWBALL) { - set_texture(img_flyingsnowball, img_flyingsnowball, 2); + set_texture(img_flyingsnowball, img_flyingsnowball, 2, 5); physic.enable_gravity(false); } else if(kind == BAD_SPIKY) { physic.set_velocity(-1.3, 0); set_texture(img_spiky_left, img_spiky_right, 3); } else if(kind == BAD_SNOWBALL) { physic.set_velocity(-1.3, 0); - set_texture(img_snowball_left, img_snowball_right, 3); + set_texture(img_snowball_left, img_snowball_right, 4, 5); } // if we're in a solid tile at start correct that now @@ -1114,16 +1114,16 @@ void load_badguy_gfx() } /** snowball */ - for(int i = 0; i < 3; ++i) { - char num[4]; - snprintf(num, 4, "%d", i); - texture_load(&img_snowball_left[i], - datadir + "/images/shared/snowball-left-" + num + ".png", - USE_ALPHA); - texture_load(&img_snowball_right[i], - datadir + "/images/shared/snowball-right-" + num + ".png", - USE_ALPHA); - } + texture_load(&img_snowball_left[0], datadir + "/images/shared/snowball-left-0.png", USE_ALPHA); + texture_load(&img_snowball_left[1], datadir + "/images/shared/snowball-left-1.png", USE_ALPHA); + texture_load(&img_snowball_left[2], datadir + "/images/shared/snowball-left-2.png", USE_ALPHA); + texture_load(&img_snowball_left[3], datadir + "/images/shared/snowball-left-1.png", USE_ALPHA); + + texture_load(&img_snowball_right[0], datadir + "/images/shared/snowball-right-0.png", USE_ALPHA); + texture_load(&img_snowball_right[1], datadir + "/images/shared/snowball-right-1.png", USE_ALPHA); + texture_load(&img_snowball_right[2], datadir + "/images/shared/snowball-right-2.png", USE_ALPHA); + texture_load(&img_snowball_right[3], datadir + "/images/shared/snowball-right-1.png", USE_ALPHA); + texture_load(&img_snowball_squished_left[0], datadir + "/images/shared/bsod-squished-left.png", USE_ALPHA); texture_load(&img_snowball_squished_right[0], @@ -1194,7 +1194,7 @@ void free_badguy_gfx() texture_free(&img_spiky_left[i]); texture_free(&img_spiky_right[i]); } - for(int i = 0; i<3; ++i) { + for(int i = 0; i<4; ++i) { texture_free(&img_snowball_left[i]); texture_free(&img_snowball_right[i]); } diff --git a/src/player.cpp b/src/player.cpp index 6052cc4c9..a6f46b690 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -602,7 +602,7 @@ Player::draw() if (!got_coffee) { - if (physic.get_velocity_y() > 0) + if (physic.get_velocity_y() != 0) { if (dir == RIGHT) texture_draw(&smalltux_jump_right, base.x - scroll_x, base.y - 10);