Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

  1. /*************************************************
  2. * mysprite.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. // mysprite.h : header file
  8. //
  9. // CBlock class
  10. //
  11. //
  12. class CBlockDoc;
  13. class CBlock : public CPhasedSprite
  14. {
  15. DECLARE_SERIAL(CBlock)
  16. public:
  17. CBlock();
  18. ~CBlock();
  19. void SetMass(int iMass);
  20. int GetMass() {return m_mass;}
  21. void GetVelocity(int* pvx, int* pvy)
  22. {*pvx = m_vx; *pvy = m_vy;}
  23. void SetVelocity(int iVX, int iVY);
  24. void SetCode(WORD wCode) {m_wCode = wCode;}
  25. WORD GetCode() const {return m_wCode;}
  26. int UpdatePosition(CBlockDoc *pDoc);
  27. int CollideTest(CBlock* pSprite);
  28. int OnCollide(CBlock* pSprite, CBlockDoc *pDoc);
  29. void Stop();
  30. BOOL Hit(WORD wCode) {return m_wCode == wCode;}
  31. virtual void Serialize(CArchive& ar);
  32. private:
  33. int m_mass;
  34. int m_vx;
  35. int m_vy;
  36. int m_dx;
  37. int m_dy;
  38. WORD m_wCode;
  39. };