This commit is contained in:
parent
2ca7da9ba7
commit
dc9561dc93
2 changed files with 91 additions and 0 deletions
45
source/enemy/npcpath.cpp
Normal file
45
source/enemy/npcpath.cpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*=========================================================================
|
||||
|
||||
npcpath.cpp
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2000 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
bool CNpcWaypoint::isPointNear( DVECTOR testPos )
|
||||
{
|
||||
s32 xDistSqr, yDistSqr;
|
||||
|
||||
xDistSqr = testPos.vx - this->pos.vx;
|
||||
xDistSqr *= xDistSqr;
|
||||
|
||||
yDistSqr = testPos.vy - this->pos.vy;
|
||||
yDistSqr *= yDistSqr;
|
||||
|
||||
if ( xDistSqr + yDistSqr < 100 )
|
||||
{
|
||||
return( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
}
|
||||
|
||||
void CNpcPath::addWaypoint( DVECTOR newPos )
|
||||
{
|
||||
if ( waypointCount < NPC_MAX_WAYPOINTS )
|
||||
{
|
||||
waypoint[waypointCount] = newPos;
|
||||
waypointCount++;
|
||||
}
|
||||
}
|
||||
|
||||
void setPathType( NPC_PATH_TYPE newPathType );
|
||||
bool incPath();
|
||||
bool CNpcPath::incPath
|
Loading…
Add table
Add a link
Reference in a new issue