From: Ivan Hernandez Date: Sat, 16 Jun 2012 06:25:50 +0000 (-0500) Subject: changed fucktons of comments X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=275ee077796dc1cdd7ad236267fc3b119c35e39f;p=IvanGame.git changed fucktons of comments --- diff --git a/Background.h b/Background.h index c981137..2f40e26 100644 --- a/Background.h +++ b/Background.h @@ -18,28 +18,82 @@ using std::vector; */ class Background : public WorldObject{ - private: - Texture mBackground;/// collisionData;/// collisionData; - public: +public: + /** + Initializes the Background + \param name Name of the background for reference in the program + \param filename Name of the file in ArtAssets + \param wrap Whether you want the background to tile or not + \param ScreenPosition Position on the screen where the background should begin to draw. + */ Background( string name="default", - string filename="bg.bmp", - bool wrap=true, - Point2D ScreenPosition=Point2D() - ); - void draw();/**< Draw background. */ - void update();/**< Update to run each loop */ - string getName() { return mName; }/** Returns name. */ - void setName(string name) { mName = name; }/** Set Name. */ - int load(string name="default");///< Loads a Bacground by name. + string filename="bg.bmp", + bool wrap=true, + Point2D ScreenPosition=Point2D() + ); + + /** + Draw background. + */ + void draw(); + + /** + Update to run each loop + */ + void update(); + + /** + Returns name. + \return Name of the Background + */ + string getName() { return mName; } + + /** + Set Name. + \param name Name for the Background + */ + void setName(string name) { mName = name; } + + /** + Loads a Bacground by name. + \param name Name of the background to load (defaults to default) + */ + int load(string name="default"); + + /** + Obtains the Background's position + \return Current position of the Background's top left corner + */ SizeD getPosition() {return mPos;} + + /** + Obtains the Background's position + \return Current position of the Background's top left corner + */ void setWrap(bool tf); + + /** + Returns whether the background wraps or not + \return Wrapping + */ bool getWrap(); - void drawCollisions();/**< Draws Collision data for the Object (from outside) */ + + /** + Draws Collision data for the Object (from outside) + */ + void drawCollisions(); }; #endif diff --git a/Game.h b/Game.h index 9145942..77c092c 100644 --- a/Game.h +++ b/Game.h @@ -18,13 +18,16 @@ class Game { public: - /** This Makes an instance of Game if there is not one and then returns it \return The level.*/ + /** + This Makes an instance of Game if there is not one and then returns it + \return The level. + */ static Game* game(); - /** Decides whether or not to draw bounding boxes*/ + /// Decides whether or not to draw bounding boxes bool ShowCollisions; - /** Decides whether or not to output FPS*/ + /// Decides whether or not to output FPS bool ShowFPS; /** @@ -67,40 +70,51 @@ public: */ Font* getFont(int size, FontType type); - /** Makes the game loop begin and load objects. */ + /** + Makes the game loop begin and load objects. + */ void run(); - /** Returns the main screen to allow for drawing */ + /** + Returns the main screen to allow for drawing \return Pointer to the SDL_Surface of the screen + */ SDL_Surface* Screen() { return mScreen; } - /** Retrns the Current FPS of the game */ + /** + Returns the Current FPS of the game \return Unsigned int representing the FPS + */ Uint32 getFPS() { return currentFPS; } - /** The current Sprite selected by the game */ + /// The current Sprite selected by the game static Sprite* CurrentSprite; - /** State of if the game should be paused or not. */ + /// State of if the game should be paused or not. bool Paused; - /** The level that will be active next (for onloadFunctions)*/ + /// The level that will be active next (for onloadFunctions) Level* LoadingLevel; protected: Game(); ~Game(); - /** This is the pointer to the Static Game object insuring only one */ + /// This is the pointer to the Static Game object insuring only one static Game* m_instance; - /** Loads the game's resources. */ + /** + Loads the game's resources. + */ void LoadResources(); private: static const Uint32 waitTime; - - int mCurrentLevel;/**< Current Level index. */ - std::vector mLevels;/**< Vector of pointers to all of the levels. \todo Make into map? */ - SDL_Surface *mScreen;/**< The surface to draw to. */ - map mBehaviors;/**< This level's Behaviors */ + /// Current Level index. + int mCurrentLevel; + /// Vector of pointers to all of the levels. \todo Make into map? + std::vector mLevels; + /// The surface to draw to. + SDL_Surface *mScreen; + /// This level's Behaviors + map mBehaviors; map mEnglishFonts; map mJapaneseFonts; diff --git a/Sprite.h b/Sprite.h index 83952d5..0492d4c 100644 --- a/Sprite.h +++ b/Sprite.h @@ -18,63 +18,69 @@ class Sprite : public WorldObject public: Sprite(std::string name, Actor actor); /** - Changes to the specified animation beginning at 0. - \param animation The index representing the animation to move to + Changes to the specified animation beginning at 0. + \param animation The index representing the animation to move to */ void setAnimation(int animation) { mActor.mCurrentAnimation = animation; } /** - Returns active animation. (actually the current frame within the animation) \todo see if this is slower maybe undo - \return Pointer to the active Animation + Returns active animation. (actually the current frame within the animation) \todo see if this is slower maybe undo + \return Pointer to the active Animation */ SpriteFrame* getAnimation() { return &mActor.mAnimations[mActor.mCurrentAnimation]->mFrames[mActor.mFrame]; } /** - Changes to the specified frame of the animation beginning at 0. - \param frame The frame of the animation to move to + Changes to the specified frame of the animation beginning at 0. + \param frame The frame of the animation to move to */ void setFrame(int frame) { mActor.mFrame = frame; } /** - Returns active frame. - \return The index representing the Active Frame + Returns active frame. + \return The index representing the Active Frame */ int getFrame() { return mActor.mFrame; } /** - Sets the Sprite's speed. - \param speed Speed for the sprite (directly correlates to number of pixels) + Sets the Sprite's speed. + \param speed Speed for the sprite (directly correlates to number of pixels) */ void setSpeed(float speed) { mSpeed = speed; } /** - Returns a Sprite's current speed. - \return Speed of the Sprite + Returns a Sprite's current speed. + \return Speed of the Sprite */ float getSpeed() { return mSpeed;} /** - Pauses or resumes an animation. + Pauses or resumes an animation. */ void toggleAnim() { mAnimating = !mAnimating; } - /**< Causes the animation to play. */ + /** + Causes the animation to play. + */ void startAnim() {mAnimating = 1; } - /**< Causes the animation to stop. */ + /** + Causes the animation to stop. + */ void stopAnim() {mAnimating = 0; } - /**< Resets the Sprite's animation to the first frame. */ + /** + Resets the Sprite's animation to the first frame. + */ void rewind() {mActor.mFrame = 0; } /** - Draws Sprite. + Draws Sprite. */ void draw(); /** - Draws Collision data for the Object (from outside) + Draws Collision data for the Object (from outside) */ void drawCollisions(); /** - Update to run each loop + Update to run each loop */ void update(); /** - Checks for collision with sprite of a given name. + Checks for collision with sprite of a given name. */ Sprite* collisionWithSprite(string name); /** - Returns collision data + Returns collision data */ vector& getCollisionData();