home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / enemies / spika.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-01  |  2.6 KB  |  89 lines

  1. /***************************************************************************
  2.  * spika.h  -  headers for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2006 - 2008 Florian Richter
  5.  ***************************************************************************/
  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 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_SPIKA_H
  17. #define SMC_SPIKA_H
  18.  
  19. #include "../enemies/enemy.h"
  20.  
  21. /* *** *** *** *** *** *** cSpika *** *** *** *** *** *** *** *** *** *** *** */
  22.  
  23. class cSpika : public cEnemy 
  24. {
  25. /* Spika
  26.  * Will wait for you and wheel you 
  27.  * if you can't run fast enough :D
  28.  * 
  29.  * Colors : Orange, Green and Grey
  30.  */
  31. public:
  32.     // constructor
  33.     cSpika( float x, float y );
  34.     // create from stream
  35.     cSpika( CEGUI::XMLAttributes &attributes );
  36.     // destructor
  37.     virtual ~cSpika( void );
  38.  
  39.     // init defaults
  40.     void Init( void );
  41.     // copy
  42.     virtual cSpika *Copy( void );
  43.  
  44.     // create from stream
  45.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  46.     // save to stream
  47.     virtual void Save_to_Stream( ofstream &file );
  48.  
  49.     // set color
  50.     void Set_Color( DefaultColor col );
  51.  
  52.     /* downgrade state ( if already weakest state : dies )
  53.      * force : usually dies or a complete downgrade
  54.     */
  55.     virtual void DownGrade( bool force = 0 );
  56.     virtual void DieStep( void );
  57.  
  58.     // update
  59.     virtual void Update( void );
  60.  
  61.     // if update is valid for the current state
  62.     virtual bool Is_Update_Valid( void );
  63.  
  64.     /* Validate the given collision object
  65.      * returns 1 if an internal collision with this object is valid
  66.      * returns 2 if the given object collides with this object (blocking)
  67.     */
  68.     virtual unsigned int Validate_Collision( cSprite *obj );
  69.     // collision from player
  70.     virtual void Handle_Collision_Player( cObjectCollision *collision );
  71.     // collision from an enemy
  72.     virtual void Handle_Collision_Enemy( cObjectCollision *collision );
  73.     // collision with massive
  74.     virtual void Handle_Collision_Massive( cObjectCollision *collision );
  75.     // collision from a box
  76.     virtual void Handle_Collision_Box( ObjectDirection cdirection, GL_rect *r2 );
  77.  
  78.     // default speed
  79.     float speed;
  80.     // default detection size
  81.     float detection_size;
  82.     // Color
  83.     DefaultColor color_type;
  84. };
  85.  
  86. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  87.  
  88. #endif
  89.