Jeffery Hurley
/
Asteroids
Simple starter skeleton for asteroids video game.
Sprite.h@2:30020ddfccf6, 2019-03-02 (annotated)
- Committer:
- jhurley31
- Date:
- Sat Mar 02 16:11:43 2019 +0000
- Revision:
- 2:30020ddfccf6
- Child:
- 3:98aa3db6a48f
There is an issue with inheritance
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jhurley31 | 2:30020ddfccf6 | 1 | #pragma once |
jhurley31 | 2:30020ddfccf6 | 2 | |
jhurley31 | 2:30020ddfccf6 | 3 | class Sprite |
jhurley31 | 2:30020ddfccf6 | 4 | { |
jhurley31 | 2:30020ddfccf6 | 5 | public: |
jhurley31 | 2:30020ddfccf6 | 6 | enum enDIRECTIONS {NO_DIR, UP_DIR, DOWN_DIR, LEFT_DIR, RIGHT_DIR}; |
jhurley31 | 2:30020ddfccf6 | 7 | // Default Constructor |
jhurley31 | 2:30020ddfccf6 | 8 | Sprite(); |
jhurley31 | 2:30020ddfccf6 | 9 | // Constructor |
jhurley31 | 2:30020ddfccf6 | 10 | Sprite(enDIRECTIONS inDir, unsigned int inRow, unsigned int inCol); |
jhurley31 | 2:30020ddfccf6 | 11 | |
jhurley31 | 2:30020ddfccf6 | 12 | ~Sprite(){}; |
jhurley31 | 2:30020ddfccf6 | 13 | |
jhurley31 | 2:30020ddfccf6 | 14 | void SetDesiredDirectionToMove(enDIRECTIONS dir); |
jhurley31 | 2:30020ddfccf6 | 15 | |
jhurley31 | 2:30020ddfccf6 | 16 | |
jhurley31 | 2:30020ddfccf6 | 17 | virtual void Move() {} |
jhurley31 | 2:30020ddfccf6 | 18 | virtual bool IsMoveAllowed() {return false;} |
jhurley31 | 2:30020ddfccf6 | 19 | |
jhurley31 | 2:30020ddfccf6 | 20 | protected: |
jhurley31 | 2:30020ddfccf6 | 21 | |
jhurley31 | 2:30020ddfccf6 | 22 | enDIRECTIONS m_CurrentDirection; |
jhurley31 | 2:30020ddfccf6 | 23 | enDIRECTIONS m_DesiredDirection; |
jhurley31 | 2:30020ddfccf6 | 24 | |
jhurley31 | 2:30020ddfccf6 | 25 | unsigned int m_RowPos; |
jhurley31 | 2:30020ddfccf6 | 26 | unsigned int m_ColPos; |
jhurley31 | 2:30020ddfccf6 | 27 | |
jhurley31 | 2:30020ddfccf6 | 28 | |
jhurley31 | 2:30020ddfccf6 | 29 | }; |