- moved some collision code into the world class, since it only acts on world data
[supertux.git] / src / collision.h
1 // C Interface: collision
2 //
3 // Description: 
4 //
5 //
6 // Author: Tobias Glaesser <tobi.web@web.de>, (C) 2004
7 //
8 // Copyright: See COPYING file that comes with this distribution
9 //
10 //
11
12 #ifndef SUPERTUX_COLLISION_H
13 #define SUPERTUX_COLLISION_H
14
15 #include "type.h"
16
17 class Tile;
18 class World;
19
20 /* Collision objects */
21 enum
22 {
23   CO_BULLET,
24   CO_BADGUY,
25   CO_PLAYER
26 };
27
28 enum CollisionType {
29     COLLISION_NORMAL,
30     COLLISION_BUMP,
31     COLLISION_SQUISH
32 };
33
34 bool rectcollision(base_type* one, base_type* two);
35 bool rectcollision_offset(base_type* one, base_type* two, float off_x, float off_y);
36
37 void collision_swept_object_map(base_type* old, base_type* current);
38 bool collision_object_map(base_type* object);
39
40 /** Return a pointer to the tile at the given x/y coordinates */
41 Tile* gettile(float x, float y);
42
43 // Some little helper function to check for tile properties
44 bool  issolid(float x, float y);
45 bool  isbrick(float x, float y);
46 bool  isice(float x, float y);
47 bool  isfullbox(float x, float y);
48
49 #endif /*SUPERTUX_COLLISION_H*/
50