This commit is contained in:
parent
01f1cf7c12
commit
e65b8cd885
@ -1574,6 +1574,18 @@ void CPlayer::springPlayerUp()
|
|||||||
m_currentPlayerModeClass->springPlayerUp();
|
m_currentPlayerModeClass->springPlayerUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
int haha=25;
|
||||||
|
void CPlayer::floatPlayerUp()
|
||||||
|
{
|
||||||
|
m_moveVelocity.vy-=haha;
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
@ -2400,7 +2412,6 @@ int CPlayer::moveVertical(int _moveDistance)
|
|||||||
}
|
}
|
||||||
else if(_moveDistance<0)
|
else if(_moveDistance<0)
|
||||||
{
|
{
|
||||||
// Must be below ground
|
|
||||||
// Are we jumping into an impassable block?
|
// Are we jumping into an impassable block?
|
||||||
if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy+_moveDistance)&COLLISION_TYPE_MASK)!=COLLISION_TYPE_FLAG_NORMAL&&
|
if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy+_moveDistance)&COLLISION_TYPE_MASK)!=COLLISION_TYPE_FLAG_NORMAL&&
|
||||||
getHeightFromGround(pos.vx,pos.vy+_moveDistance)<=0)
|
getHeightFromGround(pos.vx,pos.vy+_moveDistance)<=0)
|
||||||
@ -2409,6 +2420,14 @@ int CPlayer::moveVertical(int _moveDistance)
|
|||||||
_moveDistance=0;
|
_moveDistance=0;
|
||||||
hitGround=true;
|
hitGround=true;
|
||||||
}
|
}
|
||||||
|
else if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy+_moveDistance-HEIGHT_FOR_HEAD_COLLISION)&COLLISION_TYPE_MASK)!=COLLISION_TYPE_FLAG_NORMAL&&
|
||||||
|
getHeightFromGround(pos.vx,pos.vy+_moveDistance-HEIGHT_FOR_HEAD_COLLISION)<=0)
|
||||||
|
{
|
||||||
|
pos.vy=((pos.vy+_moveDistance)&0xfff0);
|
||||||
|
_moveDistance=0;
|
||||||
|
hitGround=true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -244,7 +244,8 @@ public:
|
|||||||
int getAnimNo();
|
int getAnimNo();
|
||||||
void setAnimNo(int _animNo);
|
void setAnimNo(int _animNo);
|
||||||
|
|
||||||
void springPlayerUp();
|
void springPlayerUp(); // Springy branches
|
||||||
|
void floatPlayerUp(); // Geysers
|
||||||
void teleportTo(int _x,int _y);
|
void teleportTo(int _x,int _y);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -425,6 +426,7 @@ public:
|
|||||||
{
|
{
|
||||||
COLSIZE_BASE_WIDTH=30,
|
COLSIZE_BASE_WIDTH=30,
|
||||||
COLSIZE_BASE_HEIGHT=60,
|
COLSIZE_BASE_HEIGHT=60,
|
||||||
|
HEIGHT_FOR_HEAD_COLLISION=64,
|
||||||
};
|
};
|
||||||
void resetPlayerCollisionSizeToBase();
|
void resetPlayerCollisionSizeToBase();
|
||||||
void setPlayerCollisionSize(int _x,int _y,int _w,int _h);
|
void setPlayerCollisionSize(int _x,int _y,int _w,int _h);
|
||||||
|
Loading…
Reference in New Issue
Block a user