1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// physics.cpp: no physics books were hurt nor consulted in the construction of
// this code. All physics computations and constants were invented on the fly
// and simply tweaked until they "felt right", and have no basis in reality.
// Collision detection is simplistic but very robust (uses discrete steps at
// fixed fps).
#include "cube.h"
#import "DynamicEntity.h"
#import "Entity.h"
#import "MapModelInfo.h"
#import "Monster.h"
#import "Player.h"
// collide with player or monster
static bool
plcollide(
DynamicEntity *d, DynamicEntity *o, float *headspace, float *hi, float *lo)
{
if (o.state != CS_ALIVE)
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// physics.cpp: no physics books were hurt nor consulted in the construction of
// this code. All physics computations and constants were invented on the fly
// and simply tweaked until they "felt right", and have no basis in reality.
// Collision detection is simplistic but very robust (uses discrete steps at
// fixed fps).
#include "cube.h"
#import "DynamicEntity.h"
#import "Entity.h"
#import "MapModelInfo.h"
#import "Monster.h"
#import "Player.h"
#import "Variable.h"
// collide with player or monster
static bool
plcollide(
DynamicEntity *d, DynamicEntity *o, float *headspace, float *hi, float *lo)
{
if (o.state != CS_ALIVE)
|