console: Format tabs semi-intelligently
[attac-man.git] / include / bomb.h
blob0a35db00ea69c7b7f2315a07a7264d71ac238bec
1 /*
2 Pacman Arena
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: bomb.h,v 1.3 2003/11/27 22:11:57 nsubtil Exp $ */
21 #ifndef _BOMB_H
22 #define _BOMB_H
24 #define BOMB_STATE_NONE 0
25 #define BOMB_STATE_COUNTDOWN 1
26 #define BOMB_STATE_EXPLOSION 2
29 /* constants */
30 #define BOMB_FLAME_TIME 0.5
31 #define BOMB_FLAME_TIME_SQ (BOMB_FLAME_TIME * BOMB_FLAME_TIME)
33 #define BOMB_PARTICLE_LIFE 0.2
34 #define BOMB_PARTICLE_FADE 0.3
35 #define BOMB_PARTICLE_RATE 300.0
36 #define BOMB_PARTICLE_SIZE 1.0
37 #define BOMB_PARTICLE_SPREAD 0.5
38 #define BOMB_PARTICLE_SPEED 0.02
39 #define BOMB_PARTICLE_SPEED_SPREAD 0.005
40 #define BOMB_PARTICLE_GRAVITY 0.01
43 flames start out from the bomb position with a starting speed V0
44 they suffer constant acceleration such that they stop in BOMB_FLAME_TIME seconds
45 thus:
46 V0 = 2 * radius / BOMB_FLAME_TIME
47 a = -2 * radius / BOMB_FLAME_TIME^2
50 struct bomb
52 int id;
54 int owner;
56 float position[3];
57 float time;
58 float countdown;
59 float radius;
60 int state;
62 struct particle_src *trail_left;
63 struct particle_src *trail_right;
64 struct particle_src *trail_up;
65 struct particle_src *trail_down;
66 struct particle_src *explosion;
68 struct object *model;
69 int n_frames;
72 void bomb_new(struct game *game, int player_no, float radius);
73 void bomb_explode(struct game *game, int bomb_no);
74 void bomb_update(struct game *game, int bomb_no, float delta);
75 void bomb_remove(struct game *game, int bomb_no);
77 #endif