rotagon/col.c

28 lines
400 B
C
Raw Normal View History

2015-01-01 04:57:59 +00:00
/*
** col.c - Collisions
**
** 2014 - Frank Villaro-Dixon <Frank@Villaro-Dixon.eu>
*/
#include <stdio.h>
#include <stdlib.h>
#include "game.h"
#include "obs.h"
int
has_collision(struct s_game *g, struct s_obstacle o) {
int face = get_face_from_cursor(g);
if(face != o.face)
return 0;
if(o.distance <= CURSOR_DIST &&
o.distance + o.thick >= CURSOR_DIST) {
return 1;
}
return 0;
}