SBSPSS/source/player/pmfly.cpp

98 lines
1.9 KiB
C++
Raw Normal View History

2001-02-28 17:36:16 +01:00
/*=========================================================================
2001-03-23 20:44:14 +01:00
pmfly.cpp
2001-02-28 17:36:16 +01:00
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
2001-03-23 20:44:14 +01:00
#include "player\pmfly.h"
2001-02-28 17:36:16 +01:00
#ifndef __PLAYER_PLAYER_H__
2001-03-23 20:44:14 +01:00
#include "player\player.h"
2001-02-28 17:36:16 +01:00
#endif
/* Std Lib
------- */
/* Data
---- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-03-23 20:44:14 +01:00
void CPlayerModeFly::enter()
2001-02-28 17:36:16 +01:00
{
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-05-09 19:30:40 +02:00
#if defined(__USER_paul__)
2001-08-03 23:16:05 +02:00
int playerflyspeed=30;
2001-05-09 19:30:40 +02:00
#elif defined(__USER_daveo__)
int playerflyspeed=10;
2001-05-01 18:26:31 +02:00
#else
static const int playerflyspeed=5;
#endif
2001-03-23 20:44:14 +01:00
void CPlayerModeFly::think()
2001-02-28 17:36:16 +01:00
{
2001-03-23 20:44:14 +01:00
DVECTOR pos;
int controlHeld;
pos=getPlayerPos();
controlHeld=getPadInputHeld();
if(controlHeld&PI_LEFT)
{
2001-05-01 18:26:31 +02:00
pos.vx-=playerflyspeed;
2001-03-23 20:44:14 +01:00
}
else if(controlHeld&PI_RIGHT)
{
2001-05-01 18:26:31 +02:00
pos.vx+=playerflyspeed;
2001-03-23 20:44:14 +01:00
}
if(controlHeld&PI_UP)
{
2001-05-01 18:26:31 +02:00
pos.vy-=playerflyspeed;
2001-03-23 20:44:14 +01:00
}
else if(controlHeld&PI_DOWN)
2001-02-28 17:36:16 +01:00
{
2001-05-01 18:26:31 +02:00
pos.vy+=playerflyspeed;
2001-02-28 17:36:16 +01:00
}
2001-03-23 20:44:14 +01:00
setPlayerPos(&pos);
2001-02-28 17:36:16 +01:00
}
/*===========================================================================
end */