Advertisement
Vchavauty

Object.h

Jul 26th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.46 KB | None | 0 0
  1. #ifndef _OBJECT_HEADER
  2. #define _OBJECT_HEADER
  3. #include <SDL/SDL.h>
  4. #include "Animation.h"
  5. #include "Surface.h"
  6.  
  7. class Object
  8. {
  9. private :
  10.     int State; //State of the Object
  11.     char *IMGFile; // The Name of the File: img/yoshi.bmp will be used
  12.     int PosX; //Position X on screen
  13.     int PosY; //Position Y on Screen
  14.     int MaxJump; //Ignore this. It will only be used later.
  15.     int CurrentFrame[2]; //[0] For X Frame; [1] For Y Frame;
  16.     Animation Animate; //Calling a object to the Animation Class
  17. public :
  18.  
  19.     enum{
  20.     EVENT_WALK = 0,
  21.     EVENT_RUN,
  22.     EVENT_JUMP,
  23.     EVENT_STOP
  24.     };  //This will be sent to the Animate Function, so it knows what the heck is it supposed to do
  25.      enum{
  26.     STATE_PASSIVE = 0,
  27.     STATE_WALKING,
  28.     STATE_JUMPING,
  29.     STATE_FALLING
  30.     };//This will be used to send information of which Frame should be used on render. Right now this is not really usefull
  31.  
  32.     SDL_Surface *Img_Surface; //The Surface that will hold the Character Image
  33.     Object();
  34.     bool Init(char *File); //This will load FILE onto the Surface
  35.     int RetrievePosX(); //Return POS X
  36.     int RetrievePosY(); //Return POS Y
  37.     int RetrieveFrameByID(int ID); //0 = X;1 = Y;
  38.     void GetValues(); //Get the Values of Animation and write them on POSX and POSY
  39.     void SendAnimation(); //It will call the Animate Function
  40.     void ReceiveEvent(int  Event, int Direction); //Receive the event from APP
  41.  
  42. };
  43. #endif // _OBJECT_HEADER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement