[Clonekeenplus-commits] [SCM] clonekeenplus branch, master, updated. 00100f4d899e0c7c5766ee88b3507e
Commander Keen Interpreter
Brought to you by:
gerstrong
From: Gerstrong <ger...@us...> - 2010-08-26 16:06:08
|
via 00100f4d899e0c7c5766ee88b3507ef682327466 (commit) from dfba1d89b62d253b322ab7fd046748237602c5f2 (commit) - Log ----------------------------------------------------------------- commit 00100f4d899e0c7c5766ee88b3507ef682327466 Author: Gerhard Stein <ger...@gm...> Date: Thu Aug 26 18:04:45 2010 +0200 improvements to the cmake file and improved Garg behavior ----------------------------------------------------------------------- Summary of changes: makeAllBuilds.sh | 2 +- src/common/CPlayer.cpp | 6 ++- src/common/CPlayerLevel.cpp | 6 ++- src/engine/vorticon/ai/CGarg.cpp | 97 +++++++++++++++++++------------------- src/engine/vorticon/ai/CGarg.h | 2 +- 5 files changed, 59 insertions(+), 54 deletions(-) diff --git a/makeAllBuilds.sh b/makeAllBuilds.sh index 541b974..0034a5e 100755 --- a/makeAllBuilds.sh +++ b/makeAllBuilds.sh @@ -12,7 +12,7 @@ make cmake . -DBUILD_TYPE=LINUX32 -DDEBUG=OFF -DOGG=yes -DTREMOR=NO make -rm CMakeBuilds -R +rm CMakeFiles -R # upload the packages #rsync -e ssh CG-SVN-${dt}-win32.zip gerstrong,clo...@fr...:/home/frs/project/c/cl/clonekeenplus/ diff --git a/src/common/CPlayer.cpp b/src/common/CPlayer.cpp index 2d8bb88..e16eedb 100644 --- a/src/common/CPlayer.cpp +++ b/src/common/CPlayer.cpp @@ -353,7 +353,8 @@ void CPlayer::Walking() if (pwalkincreasetimer>=cur_pfastincrate) { if(pfalling) xinertia+=(1<<2); - else xinertia+=(1<<4); + //else xinertia+=(1<<4); + else xinertia+=(1<<3); pwalkincreasetimer=0; } else pwalkincreasetimer++; @@ -374,7 +375,8 @@ void CPlayer::Walking() if (pwalkincreasetimer>=cur_pfastincrate) { if(pfalling) xinertia-=(1<<2); - else xinertia-=(1<<4); + //else xinertia-=(1<<4); + else xinertia-=(1<<3); pwalkincreasetimer=0; } else pwalkincreasetimer++; diff --git a/src/common/CPlayerLevel.cpp b/src/common/CPlayerLevel.cpp index 2afd639..7833e38 100644 --- a/src/common/CPlayerLevel.cpp +++ b/src/common/CPlayerLevel.cpp @@ -595,8 +595,10 @@ void CPlayer::JumpAndPogo() // If we are in Godmode, use the Pogo, and pressing the jump button, make the player fly if( godmode && ppogostick ) { - if(playcontrol[PA_X] < 0) xinertia-=4; - if(playcontrol[PA_X] > 0) xinertia+=4; + //if(playcontrol[PA_X] < 0) xinertia-=4; + //if(playcontrol[PA_X] > 0) xinertia+=4; + if(playcontrol[PA_X] < 0) xinertia-=3; + if(playcontrol[PA_X] > 0) xinertia+=3; if(playcontrol[PA_JUMP] && !blockedu) moveUp(PPOGOUP_SPEED); } diff --git a/src/engine/vorticon/ai/CGarg.cpp b/src/engine/vorticon/ai/CGarg.cpp index 905ac40..1bed074 100644 --- a/src/engine/vorticon/ai/CGarg.cpp +++ b/src/engine/vorticon/ai/CGarg.cpp @@ -134,11 +134,11 @@ void CGarg::process() detectedPlayer = 0; std::vector<CPlayer>::iterator it = m_Player.begin(); - for( size_t i=0; it != m_Player.end() ; it++ ) + for( size_t i=0 ; it != m_Player.end() ; it++ ) { - if ( it->getYPosition() >= getYUpPos() ) + if ( it->getYDownPos() >= getYDownPos()-(16<<STC) ) { - if ( it->getYDownPos() <= getYDownPos() ) + if ( it->getYDownPos() <= getYDownPos()+(16<<STC) ) { detectedPlayer = 1; detectedPlayerIndex = i; @@ -188,63 +188,64 @@ void CGarg::process() else state = GARG_CHARGE; - if(TileProperties.at(mp_Map->at((getXMidPos())>>CSF, (getYDownPos()+1)>>CSF)).bup) // There is floor + if( blockedd ) // There is floor state = GARG_CHARGE; - else - { - moveUp(GARG_JUMP_SPEED); - } - // In this case continue with charge + charge(); + break; case GARG_CHARGE: - if (movedir==LEFT) - { // garg is charging left - sprite = GARG_WALK_LEFT + walkframe; - if (!blockedl) - { - xinertia = -GARG_CHARGE_SPEED; - dist_traveled++; - } - else - { - looktimes = 0; - timer = 0; - state = GARG_MOVE; - } - } - else - { // garg is charging right - sprite = GARG_WALK_RIGHT + walkframe; - if (!blockedr) - { - xinertia = GARG_CHARGE_SPEED; - dist_traveled++; - } - else - { - looktimes = 0; - timer = 0; - state = GARG_MOVE; - } - } + charge(); // if Garg is about to fall while charged make him jump - if( !TileProperties.at(mp_Map->at((getXMidPos())>>CSF, (getYDownPos()+1)>>CSF)).bup ) + if( !blockedd ) { state = GARG_JUMP; + yinertia = -(GARG_JUMP_SPEED); jumptime = GARG_JUMP_TIME; } - // walk animation - if (timer > GARG_CHARGE_ANIM_TIME) - { - walkframe ^= 1; - timer = 0; - } else timer++; break; default: break; } } -CGarg::~CGarg() -{} +void CGarg::charge() +{ + if (movedir==LEFT) + { // garg is charging left + sprite = GARG_WALK_LEFT + walkframe; + if (!blockedl) + { + xinertia = -GARG_CHARGE_SPEED; + dist_traveled++; + } + else + { + looktimes = 0; + timer = 0; + state = GARG_MOVE; + } + } + else + { // garg is charging right + sprite = GARG_WALK_RIGHT + walkframe; + if (!blockedr) + { + xinertia = GARG_CHARGE_SPEED; + dist_traveled++; + } + else + { + looktimes = 0; + timer = 0; + state = GARG_MOVE; + } + } + + // walk animation + if (timer > GARG_CHARGE_ANIM_TIME) + { + walkframe ^= 1; + timer = 0; + } else timer++; +} diff --git a/src/engine/vorticon/ai/CGarg.h b/src/engine/vorticon/ai/CGarg.h index 87fc484..8e6872d 100644 --- a/src/engine/vorticon/ai/CGarg.h +++ b/src/engine/vorticon/ai/CGarg.h @@ -46,7 +46,7 @@ public: CGarg(CMap *p_map, std::vector<CPlayer> &m_vec_Player, Uint32 x, Uint32 y); void process(); - virtual ~CGarg(); + void charge(); private: enum garg_states{ hooks/post-receive -- clonekeenplus |