blob: db3893f0c6702e910366903c4bdbbe5ebd18b7cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#include <common.h>
#include <game.h>
#include <g3dhax.h>
extern "C" bool CollidedWithTile(u8 *);
extern "C" int handleTileCollision(dEn_c *);
void ThwompaDompMoveC(dEn_c *Sprite) {
bool FirstCheck;
bool SecondCheck;
// Check for collisions with walls?
FirstCheck = CollidedWithTile(Sprite->classAt1EC);
handleTileCollision(Sprite);
SecondCheck = CollidedWithTile(Sprite->classAt1EC);
OSReport("XPos = %f, FirstCheck = %d, SecondCheck = %d", Sprite->pos.x, FirstCheck, SecondCheck);
if ((FirstCheck != 0) && (SecondCheck != 0)) {
OSReport("Actually doing something, I swear");
Sprite->pos.y = Sprite->pos.y + 16.0;
Sprite->pos.x = Sprite->pos.x - 180.0;
if (Sprite->direction == 0) {
Sprite->direction = 1;
Sprite->pos.x = Sprite->pos.x - 80.0; }
else {
Sprite->direction = 0;
Sprite->pos.x = Sprite->pos.x + 80.0; }
}
else {
if (Sprite->direction == 0) {
Sprite->pos.x = Sprite->pos.x + 1.0; }
else {
Sprite->pos.x = Sprite->pos.x - 1.0; }
}
return;
}
|