The Tricycle's Ninja
|
00001 #ifndef _JUGADOR_H_ 00002 #define _JUGADOR_H_ 00003 00004 #include <Gosu/Gosu.hpp> 00005 00009 class Jugador 00010 { 00011 Gosu::Image image; 00012 double posX, posY, velX, velY; 00013 int angle; 00014 00015 public: 00020 Jugador(Gosu::Graphics& graphics):image(graphics,Gosu::sharedResourcePrefix() + L"media/bueno3.png") { 00021 posX = 100; posY = 345; velX = 1.5; velY = angle = 0; 00022 } 00026 void draw() const 00027 { 00028 image.drawRot(posX, posY,2,angle,0.5,0.5,0.5,0.5); 00029 } 00034 void move() 00035 { 00036 posX = Gosu::wrap(posX+velX, 0.0, 800.0); 00037 posY = Gosu::wrap(posY+velY, 0.0, 600.0); 00038 } 00043 double px(){return posX;} 00048 double py(){return posY;} 00053 double pangle(){return angle;} 00058 void modpx(int num){posX = num;} 00063 void modpy(int num){posY = num;} 00068 void modangle(int num){angle = num;} 00072 void reset(){posX=100;posY=345;velX=1.5;velY=0;angle=0;} 00076 void acelerar(){velX=velX*1.25;} 00077 00078 }; 00079 00080 #endif /*_JUGADOR_H_*/