PongBackground.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. #ifndef __PONGBACKGROUND__
  5. #define __PONGBACKGROUND__
  6. class PongApp;
  7. #include "GameEngine.h"
  8. #define THEME_COUNT 1
  9. #define BG_SPRITECOUNT 4
  10. class PongBackground {
  11. public:
  12. PongBackground( int effectIndex, GF::GameEngine *engine, PongApp *app );
  13. ~PongBackground();
  14. // return true if still wants to be alive.
  15. bool update( const float frameTime );
  16. void render( float camx, float camy );
  17. void prepare();
  18. void release();
  19. protected:
  20. PongApp *pongApp;
  21. SpriteBatch *spriteBatch;
  22. int themeTextureBackground[THEME_COUNT];
  23. int themeTextureLayer[THEME_COUNT];
  24. int themeTexturePlanet[THEME_COUNT];
  25. int texture1;
  26. int texture2;
  27. int sprite1tex;
  28. float fade;
  29. bool visible;
  30. struct BgSprite {
  31. float x;
  32. float y;
  33. float size;
  34. float speed;
  35. float distance;
  36. };
  37. void initSprite( BgSprite *sprite, bool anywhere );
  38. BgSprite sprites[ BG_SPRITECOUNT ];
  39. private:
  40. GF::GameEngine *m_engine;
  41. };
  42. #endif