3 Copyright (C) 2003 Nuno Subtil
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 /* $Id: ghost.h,v 1.4 2003/11/27 22:11:57 nsubtil Exp $ */
25 #define GHOST_STATE_ACTIVE 0
26 #define GHOST_STATE_DYING 1
27 #define GHOST_STATE_DEAD 2
28 #define GHOST_STATE_RETURNING 3
30 #define GHOST_SPEED 4.0
36 /* normal, comido, ... */
39 /* posição em world-space */
41 /* direcção do movimento */
43 /* velocidade (tiles / segundo) */
45 /* tempo que resta até mudar de direcção */
48 /* animação para o fantasma */
49 struct object
*model_active
;
52 struct object
*model_dying
;
55 struct object
*model_dead
;
58 struct object
*model_returning
;
64 /* distância máxima (vertical / horizontal) a que o fantasma detecta um jogador */
73 #define GHOST_GREEN 18.0/256.0, 222.0/256.0, 18.0/256.0, 1.0
74 #define GHOST_RED 246.0/256.0, 67.0/256.0, 18.0/256.0, 1.0
75 #define GHOST_MAGENTA 224.0/256.0, 18.0/256.0, 243.0/256.0, 1.0
76 #define GHOST_ORANGE 252.0/256.0, 122.0/256.0, 0.0, 1.0
78 extern GLfloat ghost_colors
[4][4];
79 extern int num_ghost_colors
;
81 void ghost_taint_all(struct game
*game
);
82 void ghost_untaint_all(struct game
*game
);
83 void ghost_reset_all(struct game
*game
);
84 void ghost_kill(struct game
*game
, struct ghost
*g
);
85 void ghost_update(struct game
*game
, int ghost_no
, float delta
);
86 void ghost_detect_ghost_collisions(struct game
*game
, struct ghost
*g
);
87 int ghost_in_position(struct game
*game
, int x
, int y
);
88 void ghost_detect_player_collisions(struct game
*game
, struct ghost
*g
);
89 int ghost_check_visibility(struct game
*game
, struct ghost
*g
, int *r_dist
);
90 void ghost_new_direction(struct game
*game
, struct ghost
*g
);