/* * $Id: sprite.h,v 1.1.1.1 2002/08/18 17:28:52 aeneas Exp $ * Copyright (c) 2002, Dominik Schnitzer * * JFK - JFK Fucking Killerz, a massive multiplayer 2d shoot'em-up game * http://relax.ath.cx/jfk/ * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef JFK_SPRITE_H #define JFK_SPRITE_H #include #include #include "output.h" using namespace std; namespace JFK { namespace client { class sprite { public: sprite(output* output, const string& section, const string& file); ~sprite(); /* TODO: implement animations and sprite status */ /* Set the right image for the given direction vector, status and * increase (if availabe the current animation frame */ void update(double dx, double dy, int status); /* Gives the user direct access to set the current image. Be sure * you know how to set the current image. * angle is the angle image, anim the anim frame of this angle and * status sets the requested object status*/ void set(int angle, int anim, int status); /* Draw the sprite at the specified position. Please keep in mind, * that everything is drawn from the cente(!). The x/y values * specify the image center */ void draw_centered(int x, int y); void draw(int x, int y); /* Return the image that would be drawn now, if draw was called */ image get_current() { return current; }; private: image current; vector images; output* out; }; } } #endif /* JFK_SPRITE_H */