PinkLiner.cpp 933 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "PinkLiner.h"
  2. PinkLiner::PinkLiner()
  3. {
  4. //ctor
  5. }
  6. PinkLiner::~PinkLiner()
  7. {
  8. //dtor
  9. }
  10. void PinkLiner::init( b2World &world, float x, float y, float angle )
  11. {
  12. // Images
  13. if ( m_imgCar == nullptr )
  14. {
  15. m_imgCar = SDL_LoadBMP("Textures/LinerRose.bmp");
  16. SDL_SetColorKey( m_imgCar, SDL_SRCCOLORKEY, SDL_MapRGBA( m_imgCar->format, 0, 0, 0, 255 ) );
  17. }
  18. if ( m_imgWheel == nullptr )
  19. {
  20. m_imgWheel = SDL_LoadBMP("Textures/LinerWheelRose.bmp");
  21. SDL_SetColorKey( m_imgWheel, SDL_SRCCOLORKEY, SDL_MapRGBA( m_imgWheel->format, 0, 0, 0, 255 ) );
  22. }
  23. // Être propre sur soi
  24. destroy( world );
  25. // Eléments
  26. createCarenage( world, x, y, 0.5f, 0.2f );
  27. b2Vec2 rel ;
  28. rel.Set( -0.5f, 0.1f );
  29. createMotorWheel( world, rel, 10.0f, 0.1f );
  30. rel.Set( 0.5f, 0.1f );
  31. createFreeWheel( world, rel, 10.0f, 0.1f );
  32. // Fin
  33. return ;
  34. }