1 /* 2 * SparkleManager.h 3 * Daniel Nelson - 8/24/0 4 * 5 * Copyright (C) 2000 Daniel Nelson 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 * 21 * Daniel Nelson - aluminumangel.org 22 * 174 W. 18th Ave. 23 * Columbus, OH 43210 24 */ 25 26 #ifndef SPARKMANAGER_H 27 #define SPARKMANAGER_H 28 29 using namespace std; 30 31 #include "Displayer.h" 32 33 class Spark { 34 public: 35 bool active; 36 float x, y; 37 float v_x, v_y; 38 float a; 39 float v_a; 40 float size; 41 int color; 42 int life_time; 43 }; 44 45 class Mote { 46 public: 47 bool active; 48 float x, y; 49 float v_x, v_y; 50 float a; 51 float initial_a; 52 float v_a; 53 int color; 54 int type; 55 float size; 56 float inverse_mass; 57 float brightness; 58 int life_time; 59 int sibling_delay; 60 int associated_light; 61 int light_color; 62 }; 63 64 /* static */ class SparkleManager { 65 public: 66 static void initialize ( ); 67 static void timeStep ( ); 68 69 static void createBlockDeathSpark ( int x, int y, int color, int n ); 70 static void createCelebrationSpark ( int source, int color ); 71 static void createRewardMote ( int x, int y, int level, 72 int sibling_number = 0 ); 73 74 // the block death sparkles 75 static int spark_count; 76 static Spark sparks[DC_MAX_SPARK_NUMBER]; 77 78 // the combo reward sparkles 79 static int mote_count; 80 static Mote motes[DC_MAX_MOTE_NUMBER]; 81 82 private: 83 static const int mote_colors[DC_NUMBER_MOTE_LEVELS]; 84 static const int mote_light_colors[DC_NUMBER_MOTE_LEVELS]; 85 static const int mote_types[DC_NUMBER_MOTE_LEVELS]; 86 static const GLfloat mote_sizes[DC_NUMBER_MOTE_LEVELS]; 87 static const float mote_inverse_masses[DC_NUMBER_MOTE_LEVELS]; 88 }; 89 90 #endif 91