1 /* 2 Copyright (C) 2004 Parallel Realities 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 13 See the GNU General Public License for more details. 14 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. 18 19 */ 20 21 class Sprite : public GameObject { 22 23 public: 24 25 char name[50]; 26 27 SDL_Surface *image[10]; 28 unsigned char frameLength[10]; 29 30 unsigned char currentFrame; 31 float currentTime; 32 unsigned char maxFrames; 33 34 bool randomFrames; 35 36 Sprite(); 37 virtual ~Sprite(); 38 void setFrame(int i, SDL_Surface *shape, int time); 39 void animate(float amount); 40 void getNextFrame(unsigned char *frame, unsigned char *time); 41 SDL_Surface *getCurrentFrame(); 42 void free(); 43 void destroy(); 44 45 }; 46