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.
Dependencies: mbed
SpaceInvader.h
00001 #ifndef SPACEINVADER_H 00002 #define SPACEINVADER_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 00008 /** SpaceInvader class 00009 00010 @brief Class for Spaceinvader 00011 00012 @version 1.0 00013 00014 @author Henri Rigby 00015 00016 @date May 2019 00017 00018 */ 00019 00020 class SpaceInvader 00021 { 00022 public: 00023 /**constructor*/ 00024 SpaceInvader(); 00025 /**destructor*/ 00026 ~SpaceInvader(); 00027 /** 00028 * @brief Sets spaceinvader starting position and speed 00029 * @param sets position and speed @details Sets starting position and speed of the spaceinvader 00030 */ 00031 void init(int height,int width); 00032 /** 00033 * @brief Draw the spaceinvader 00034 * @return draws spaceinvader @details Uses designed sprite to draw a spaceinvader 00035 */ 00036 void draw(N5110 &lcd); 00037 /** 00038 * @brief Updates the position of the spaceinvader 00039 * @param sets position @details Uses movement of joystick to set position of spaceinvader 00040 */ 00041 void update(Direction d,float mag); 00042 /** 00043 * @brief Gets the position 00044 * @return position @details returns the position of both the x and y coordinates 00045 */ 00046 Vector2D get_pos(); 00047 00048 private: 00049 00050 int _height; 00051 int _width; 00052 int _x; 00053 int _y; 00054 int _speed; 00055 00056 }; 00057 #endif
Generated on Thu Jul 14 2022 11:01:22 by
1.7.2