ShellSprite.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 5 -*- */
00002 
00003 /*
00004  * Combination of a first person action and a real time strategy battle game.
00005  */
00006  
00007 /*
00008  * ShellSprite.h
00009  * MetalWarriors
00010  * $Revision: 1.18 $
00011  *
00012  * Created by Daniel Aarno on Thu Nov 13 2003.
00013  * Copyright (c) 2003 Daniel Aarno and Erik Ytterberg - All rights reserved.
00014  *
00015  *     This program is free software; you can redistribute it and/or modify
00016  *     it under the terms of the GNU General Public License as published by
00017  *     the Free Software Foundation; either version 2 of the License, or
00018  *     (at your option) any later version.
00019  *
00020  *     This program is distributed in the hope that it will be useful,
00021  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *     GNU General Public License for more details.
00024  *
00025  *     You should have received a copy of the GNU General Public License
00026  *     along with this program; if not, write to the Free Software
00027  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00028  */
00029 
00030 #ifndef _SHELL_SPRITE_
00031 #define _SHELL_SPRITE_
00032 
00033 #include "Sprite.h"
00034 #include "ResourceHandler.h"
00035 
00036 class Model;
00037 
00038 class ShellSprite : public Sprite
00039 {
00040 private:
00041      static bool initialized;
00042      static Model *m;
00043      std::list<float> trajectory;
00044      bool canExplode;
00045 
00046 public:
00050      ShellSprite() : Sprite(), canExplode(true)  {
00051           setVisible(false); setActive(false); 
00052      }
00053 
00061      ShellSprite(float pos[], float vel[], float rot[], bool dummy = false);
00062      //virtual ~ShellSprite();
00063      
00064      virtual void update();
00065      virtual void paint();
00066      virtual bool notifyCollision(Sprite *sender);
00067      virtual bool checkCollision(Sprite *with, bool fromSelf = false);
00068 
00076      virtual void getCollisionPoint(float where[3]);
00077 
00078      virtual Packet packObject() const;
00079      virtual void setObject(Packet &p);
00080      
00081 protected:
00090      template<bool forReal>
00091      bool execUpdate(float dt);
00092      virtual void explode();
00093      static void Init();   
00094 };
00095 
00096 #endif //_SHELL_SPRITE_
00097 

Generated on Sun Mar 11 15:33:23 2007 for MetalWarriors by  doxygen 1.4.7