Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Sprite.h
00001 #pragma once 00002 00003 class Sprite 00004 { 00005 public: 00006 enum enDIRECTIONS {NO_DIR, UP_DIR, DOWN_DIR, LEFT_DIR, RIGHT_DIR}; 00007 // Default Constructor 00008 Sprite(); 00009 // Constructor 00010 Sprite(enDIRECTIONS inDir, unsigned int inRow, unsigned int inCol); 00011 00012 virtual ~Sprite(){}; 00013 00014 void SetDesiredDirectionToMove(enDIRECTIONS dir); 00015 00016 virtual void SetLocation(const int &nRow, const int &nCol) {m_RowPos=nRow;m_ColPos=nCol;}; 00017 00018 virtual void Move() = 0; 00019 virtual bool IsMoveAllowed(const int &nNewRow, const int &nNewCol) = 0; 00020 virtual int GetImageIndex() {return (m_nActiveImage++)%2;} 00021 00022 protected: 00023 00024 enDIRECTIONS m_CurrentDirection; 00025 enDIRECTIONS m_DesiredDirection; 00026 00027 unsigned int m_RowPos; 00028 unsigned int m_ColPos; 00029 int m_nActiveImage; 00030 00031 00032 };
Generated on Wed Jul 13 2022 01:21:56 by
1.7.2