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

  1. /***************************************************************************
  2.  * ball.h  -  header 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_BALL_H
  17. #define SMC_BALL_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../video/video.h"
  21. #include "../core/collision.h"
  22. #include "../objects/movingsprite.h"
  23.  
  24. /* *** *** *** *** *** *** *** Ball class *** *** *** *** *** *** *** *** *** *** */
  25.  
  26. class cBall : public cMovingSprite
  27. {
  28. public:
  29.     cBall( float x, float y, cSprite *origin_object = NULL, ball_effect btype = FIREBALL_DEFAULT );
  30.     virtual ~cBall( void );
  31.  
  32.     // delete on the next frame start
  33.     virtual void Destroy( void );
  34.  
  35.     // update
  36.     virtual void Update( void );
  37.     // draw
  38.     virtual void Draw( cSurfaceRequest *request = NULL );
  39.  
  40.     // Generate the default animation Particles
  41.     void Generate_Particles( cParticle_Emitter *anim = NULL );
  42.  
  43.     /* Validate the given collision object
  44.      * returns 1 if an internal collision with this object is valid
  45.      * returns 2 if the given object collides with this object (blocking)
  46.     */
  47.     virtual unsigned int Validate_Collision( cSprite *obj );
  48.     // default collision handler
  49.     virtual void Handle_Collision( cObjectCollision *collision );
  50.     // collision from player
  51.     virtual void Handle_Collision_Player( cObjectCollision *collision );
  52.     // collision from an enemy
  53.     virtual void Handle_Collision_Enemy( cObjectCollision *collision );
  54.     // collision with massive
  55.     virtual void Handle_Collision_Massive( cObjectCollision *collision );
  56.     // handle moved out of Level
  57.     virtual void Handle_out_of_Level( ObjectDirection dir );
  58.  
  59.     // ball origin
  60.     ArrayType origin_array;
  61.     SpriteType origin_type;
  62.     // ball type
  63.     ball_effect ball_type;
  64.  
  65.     // rotation animation counter
  66.     float counter;
  67.  
  68.     // glim animation modifier
  69.     bool glim_mod;
  70.     // glim animation counter
  71.     float glim_counter;
  72. };
  73.  
  74. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  75.  
  76. #endif
  77.