Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // Game framework code
  2. class BaseCharacter
  3. {
  4. public:
  5.     float GetHealth();
  6.     BaseSpriteComponent* GetSpriteComponent();
  7. protected:
  8.     BaseSpriteComponent* sprite;
  9.     float health;
  10. };
  11.  
  12. // Game framework code
  13. class PlatformerCharacter : BaseCharacter
  14. {
  15. public:
  16.     void Move(float speed);
  17.     void Jump();
  18.     void Crouch();
  19.     bool IsInAir();
  20.     Physics2DComponent* GetPhysicsBodyComponent();
  21.    
  22. protected:
  23.     Physics2DComponent* physics_body;
  24.     float speed;
  25.     bool in_air;
  26. };
  27.  
  28. // Game framework code
  29. class ScrollerCharacter : BaseCharacter
  30. {
  31. public:
  32.     virtual void Move(Vector2D direction);
  33.    
  34. protected:
  35. };
  36.  
  37. // Game framework code
  38. class FireGun : public BaseWeapon
  39. {
  40. public:
  41.     virtual void Fire() override;
  42.  
  43. protected:
  44.     Particle2DEmitterComponent* particles; 
  45. };
  46.  
  47. // User game code
  48. class MyPlayer : public PlatformerCharacter
  49. {
  50. public:
  51.     void Fire();
  52.     void SetWeapon(BaseWeapon* new_weapon);
  53.     BaseWeapon* GetWeapon();
  54.    
  55. protected:
  56.     BaseWeapon* weapon;
  57. };