From: Matthias Braun Date: Sun, 8 May 2005 21:43:59 +0000 (+0000) Subject: applied ravus patch X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=91bdd7025597eabbaecf40cff6062d753ca25f76;p=supertux.git applied ravus patch SVN-Revision: 2452 --- diff --git a/configure.ac b/configure.ac index f54ef0142..9ccca3f1e 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ dnl =========================================================================== dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.54]) -AC_INIT(supertux, 0.2-cvs) +AC_INIT(supertux, 0.2-svn) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_AUX_DIR([mk/autoconf]) AC_CANONICAL_TARGET @@ -83,7 +83,7 @@ else fi AC_SUBST([VARIANT]) -AC_MSG_CHECKING(wether OpenGL should be used) +AC_MSG_CHECKING(whether OpenGL should be used) AC_ARG_ENABLE(opengl, AC_HELP_STRING([--disable-opengl], [disable OpenGL support]), [enable_opengl=$enableval], enable_opengl=yes) diff --git a/src/badguy/jumpy.cpp b/src/badguy/jumpy.cpp index 34bf15d1f..7486ffd75 100644 --- a/src/badguy/jumpy.cpp +++ b/src/badguy/jumpy.cpp @@ -17,16 +17,16 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. - #include #include "jumpy.h" static const float JUMPSPEED=600; -static const float JUMPY_MID_TOLERANCE=8; +static const float JUMPY_MID_TOLERANCE=4; static const float JUMPY_LOW_TOLERANCE=2; Jumpy::Jumpy(const lisp::Lisp& reader) + : groundhit_pos_set(false) { reader.get("x", start_position.x); reader.get("y", start_position.y); @@ -62,6 +62,12 @@ Jumpy::hit(const CollisionHit& chit) { // hit floor? if(chit.normal.y < -.5) { + if (!groundhit_pos_set) + { + pos_groundhit = get_pos(); + groundhit_pos_set = true; + } + physic.set_velocity_y(JUMPSPEED); // TODO create a nice sound for this... //sound_manager->play_sound("skid"); @@ -79,14 +85,14 @@ Jumpy::active_action(float elapsed_time) dir = Sector::current()->player->get_pos().x > get_pos().x ? RIGHT : LEFT; - //FIXME: add middle and up here - if ( get_pos().y >= (start_position.y - JUMPY_MID_TOLERANCE) ) + if ( get_pos().y < (pos_groundhit.y - JUMPY_MID_TOLERANCE ) ) + sprite->set_action(dir == LEFT ? "left-up" : "right-up"); + else if ( get_pos().y >= (pos_groundhit.y - JUMPY_MID_TOLERANCE) && + get_pos().y < (pos_groundhit.y - JUMPY_LOW_TOLERANCE) ) sprite->set_action(dir == LEFT ? "left-middle" : "right-middle"); - else if ( get_pos().y >= (start_position.y - JUMPY_LOW_TOLERANCE) ) - sprite->set_action(dir == LEFT ? "left-down" : "right-down"); else - sprite->set_action(dir == LEFT ? "left-up" : "right-up"); + sprite->set_action(dir == LEFT ? "left-down" : "right-down"); } IMPLEMENT_FACTORY(Jumpy, "jumpy") diff --git a/src/badguy/jumpy.h b/src/badguy/jumpy.h index 536cbdfab..47fc4ee4e 100644 --- a/src/badguy/jumpy.h +++ b/src/badguy/jumpy.h @@ -17,7 +17,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. - #ifndef __JUMPY_H__ #define __JUMPY_H__ @@ -36,6 +35,8 @@ public: private: HitResponse hit(const CollisionHit& hit); + Vector pos_groundhit; + bool groundhit_pos_set; }; #endif diff --git a/src/title.cpp b/src/title.cpp index 7d828cbcc..f74dde61b 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -338,7 +338,7 @@ void title() Vector(0, SCREEN_HEIGHT - 50), LEFT_ALLIGN, LAYER_FOREGROUND1); context.draw_text(white_small_text, _( -"Copyright (c) 2003 SuperTux Devel Team\n" +"Copyright (c) 2005 SuperTux Devel Team\n" "This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to\n" "redistribute it under certain conditions; see the file COPYING for details.\n" ),