/***************************************************************************
easysprite.h - description
-------------------
begin : Sat Oct 5 2002
copyright : (C) 2002 by Vladimir Grichina
email : vgrichina@mail.ru
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef EASYSPRITE_H
#define EASYSPRITE_H
#include "easygamelibcommon.h"
/**
*@author Vladimir Grichina
*/
class EasySprite {
public: // Public attributes
virtual ~EasySprite();
/** Shows the sprite
*/
virtual void show();
/** Hides the sprite
*/
virtual void hide();
/** Draws the sprite
*/
virtual void draw(SDL_Surface *surface) = 0;
/** Creates sprite
*/
EasySprite(float x=0.0, float y=0.0, int visible=true);
/** Updates sprite's rect and collision_rect due to changes of
it's position and(or) surface
*/
virtual void updateRect() = 0;
/** Moves the sprite
@param time Time of moving in milliseconds
*/
virtual void doMove(int time);
/** x coordinate of sprite
*/
float x;
/** y coordinate of sprite
*/
float y;
/** Rectangular area of sprite
*/
SDL_Rect rect;
/** The rectangular area of sprite which is used while collision detection
*/
SDL_Rect collision_rect;
protected: // Protected attributes
/** is the sprite visible or no
*/
int visible;
};
#endif
| Generated by: vg on localhost.localdomain on Fri Jan 17 13:05:24 2003, using kdoc 2.0a53. |