1 /* 2 File: Sprites.h 3 Description: Handles game sprites and fonts 4 Program: BlockOut 5 Author: Jean-Luc PONS 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2 of the License, or 10 (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 #include "Types.h" 18 #include "GLApp/GLSprite.h" 19 20 class Sprites { 21 22 public: 23 Sprites(); 24 25 // Create Sprites device objects 26 int Create(DWORD width,DWORD height); 27 28 // Release device objects 29 void InvalidateDeviceObjects(); 30 31 // Render score,level and cube 32 void RenderScore(DWORD score,DWORD level,DWORD cubes); 33 34 // Render High score, pit dimension, game mode and block set 35 void RenderInfo(DWORD highScore,int x,int y,int z,int blockSet); 36 37 // Render "Game Over" and "PAUSED" 38 void RenderGameMode(int mode); 39 40 // Render "Replay" 41 void RenderReplay(); 42 43 // Render "Demo" 44 void RenderDemo(); 45 46 // Render "Practice" 47 void RenderPractice(); 48 49 // Render "On Line" 50 void RenderOnLine(); 51 52 private: 53 54 void RenderNumbers(int x,int y,char *strMumber); 55 void RenderLevel(int level); 56 void RenderBlockSet(int blockSet); 57 void RenderMode(int mode); 58 int GetNumberWidth(char number); 59 60 Sprite2D baseSprite; 61 Sprite2D gameOverSprite; 62 63 // Coordinates 64 int xScore; 65 int yScore; 66 int xCube; 67 int yCube; 68 int xhScore; 69 int yhScore; 70 int xPit; 71 int yPit; 72 int xBlock; 73 int yBlock; 74 int wScore; 75 int hScore; 76 77 int xLevel; 78 int yLevel; 79 int wLevel; 80 int hLevel; 81 82 int xReplay; 83 int yReplay; 84 int wReplay; 85 int hReplay; 86 87 int xOnline; 88 int yOnline; 89 int wOnline; 90 int hOnline; 91 92 int xGOver; 93 int yGOver; 94 int wGOver; 95 int hGOver; 96 97 int numberWidth[10]; 98 99 }; 100