SBSPSS/source/player/psbutt.cpp

151 lines
3.4 KiB
C++
Raw Normal View History

2001-01-22 18:48:36 +01:00
/*=========================================================================
psbutt.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "player\psbutt.h"
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
2001-03-23 21:09:14 +01:00
#ifndef __PLAYER_PMODES_H__
#include "player\pmodes.h"
#endif
2001-01-26 19:20:41 +01:00
#ifndef __GAME_GAMEBUBS_H__
#include "game\gamebubs.h"
#endif
2001-01-22 18:48:36 +01:00
/* Std Lib
------- */
/* Data
---- */
2001-02-26 21:05:31 +01:00
#ifndef __ANIM_SPONGEBOB_HEADER__
#include <ACTOR_SPONGEBOB_ANIM.h>
2001-01-22 18:48:36 +01:00
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
2001-04-03 18:47:07 +02:00
CPlayerStateButtBounce s_stateButtBounce;
CPlayerStateButtBounceFall s_stateButtBounceFall;
CPlayerStateButtBounceLand s_stateButtBounceLand;
2001-01-22 18:48:36 +01:00
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-03-25 22:36:28 +02:00
void CPlayerStateButtBounce::enter(CPlayerModeBase *_playerMode)
2001-01-22 18:48:36 +01:00
{
2001-03-23 21:09:14 +01:00
_playerMode->zeroMoveVelocity();
_playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCESTART);
2001-01-22 18:48:36 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-03-25 22:36:28 +02:00
void CPlayerStateButtBounce::think(CPlayerModeBase *_playerMode)
2001-01-22 18:48:36 +01:00
{
2001-03-23 21:09:14 +01:00
if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim())
2001-01-22 18:48:36 +01:00
{
2001-03-23 21:09:14 +01:00
_playerMode->setState(STATE_BUTTFALL);
2001-01-22 18:48:36 +01:00
}
}
2001-01-31 17:53:23 +01:00
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-03-25 22:36:28 +02:00
void CPlayerStateButtBounceFall::enter(CPlayerModeBase *_playerMode)
2001-01-31 17:53:23 +01:00
{
2001-03-23 21:09:14 +01:00
_playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCEEND);
2001-01-31 17:53:23 +01:00
}
2001-02-06 22:09:45 +01:00
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-03-25 22:36:28 +02:00
void CPlayerStateButtBounceFall::think(CPlayerModeBase *_playerMode)
2001-02-06 22:09:45 +01:00
{
2001-04-11 17:48:16 +02:00
_playerMode->buttFall();
2001-02-06 22:09:45 +01:00
}
2001-01-22 18:48:36 +01:00
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-03-25 22:36:28 +02:00
void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode)
2001-01-22 18:48:36 +01:00
{
2001-03-23 21:09:14 +01:00
// DVECTOR pos;
//
// pos=_playerMode->getPlayerPos();
// CGameBubicleFactory::spawnBubicles(pos.vx,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM);
2001-01-22 18:48:36 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-03-25 22:36:28 +02:00
void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode)
2001-01-22 18:48:36 +01:00
{
2001-03-23 21:09:14 +01:00
if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim())
2001-01-22 18:48:36 +01:00
{
2001-03-23 21:09:14 +01:00
_playerMode->setState(STATE_IDLE);
2001-01-22 18:48:36 +01:00
}
}
/*===========================================================================
end */