1 /* 2 Copyright (C) 2009 Facundo Domínguez 3 4 This file is part of Spacejunk. 5 6 Spacejunk is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 Foobar is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with Foobar. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef GAMECONTROLS_H 21 #define GAMECONTROLS_H 22 23 #include "inputcontrol.h" 24 #include "bar.h" 25 #include "zoomcontrol.h" 26 #include "resourcemanager.h" 27 #include "mousescroll.h" 28 #include <list> 29 30 class cWorld; 31 class Effect; 32 33 /** 34 * Implementation to play a level. 35 * Create an instance from a given cWorld instance and then call method playLevel(). 36 * This class implements some effects to draw text on top of the scene and to make 37 * fade ins and fade outs. 38 * */ 39 class GameControls { 40 public: 41 GameControls(cWorld *); 42 void playLevel(); 43 44 ~GameControls(); 45 46 bool done; 47 private: 48 InputControl ic; 49 int chTimeForward; 50 51 void begin(); 52 bool finish(); 53 void draw(); 54 void step(int); 55 bool process_events(Uint32 delta); 56 void mouseMotion(int x, int y); 57 std::list<Effect*> effects; 58 FuelBar fuelbar; 59 cWorld * w; 60 ZoomControl zc; 61 Button shipviewbt; 62 Button viewpointbt; 63 Button orbitlengthbt; 64 Button timebt; 65 Graphic quitbt,helpbt,scoredisplay; 66 MouseScroll mscroll; 67 bool active,focus,ending; 68 int lastBonus; 69 int lastCollected; 70 bool pauseMode; 71 Uint16 wheelcount; 72 int wheel; 73 std::string scorelabel, bonuslabel, collectlabel, helpstr; 74 int scorelabelx, bonuslabelx, collectlabelx, scorex; 75 friend void cycleMusic(); 76 RMFONTRef font,font12,font24pgray; 77 }; 78 79 #endif // GAMECONTROLS_H 80