rotagon/col.c
Frank Villaro-Dixon 7af5bc65a2 It works
2015-01-01 05:57:59 +01:00

27 lines
400 B
C

/*
** 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;
}