# ifndef CAR_HEADER_FILE # define CAR_HEADER_FILE // Basiques # include # include # include // Random # include # include // SDL # include # undef main # include # include // bBox2D # include # define MULTI 100.0f enum command { FREE, BREAK, GO, REVERSE }; class Car { public: Car(); virtual ~Car(); void init( b2World &world, float x, float y, float angle = 0.0f ); void drive( command cmd ); void update(); b2Vec2 GetPosition(); protected: b2Body* m_bodyCar ; b2Body* m_bodyWheelFwd ; b2Body* m_bodyWheelBack ; b2RevoluteJoint* m_motorAxe ; b2RevoluteJoint* m_fwdAxe ; SDL_Surface* m_imgCar ; SDL_Surface* m_imgWheel ; command m_cmd ; float m_currentTorque ; float m_currentSpeed ; float m_goTorque ; float m_minTorque ; float m_maxSpeed ; }; # endif // CAR_HEADER_FILE