Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _OBJECT_HEADER
- #define _OBJECT_HEADER
- #include <SDL/SDL.h>
- #include "Animation.h"
- #include "Surface.h"
- class Object
- {
- private :
- int State; //State of the Object
- char *IMGFile; // The Name of the File: img/yoshi.bmp will be used
- int PosX; //Position X on screen
- int PosY; //Position Y on Screen
- int MaxJump; //Ignore this. It will only be used later.
- int CurrentFrame[2]; //[0] For X Frame; [1] For Y Frame;
- Animation Animate; //Calling a object to the Animation Class
- public :
- enum{
- EVENT_WALK = 0,
- EVENT_RUN,
- EVENT_JUMP,
- EVENT_STOP
- }; //This will be sent to the Animate Function, so it knows what the heck is it supposed to do
- enum{
- STATE_PASSIVE = 0,
- STATE_WALKING,
- STATE_JUMPING,
- STATE_FALLING
- };//This will be used to send information of which Frame should be used on render. Right now this is not really usefull
- SDL_Surface *Img_Surface; //The Surface that will hold the Character Image
- Object();
- bool Init(char *File); //This will load FILE onto the Surface
- int RetrievePosX(); //Return POS X
- int RetrievePosY(); //Return POS Y
- int RetrieveFrameByID(int ID); //0 = X;1 = Y;
- void GetValues(); //Get the Values of Animation and write them on POSX and POSY
- void SendAnimation(); //It will call the Animate Function
- void ReceiveEvent(int Event, int Direction); //Receive the event from APP
- };
- #endif // _OBJECT_HEADER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement