#include #include #include 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; }