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: 4DGL-uLCD-SE DRV2605 EthernetInterface Game_Synchronizer MMA8452 SDFileSystem SparkfunAnalogJoystick mbed-rtos mbed wave_player
Fork of 2035_Tanks_Shell by
tank.h
00001 #ifndef TANK_H__ 00002 #define TANK_H__ 00003 00004 // This class describes a tank. You may need to add 00005 // additional member variables (and maybe even member functions) 00006 // to draw your super cool new tank. 00007 00008 class Tank { 00009 public: 00010 00011 int x, y; // Keep track of your tank's position. 00012 int w; // Tank width. 00013 int h; // Tank height. 00014 int tank_color; // Tank color. Duh :) 00015 float barrel_theta; // Barrel angle. 00016 int barrel_length; // Length of the barrel. 00017 int wheel_rad; // Radius of the wheels. 00018 00019 00020 // Construct a tank given its starting position (sx, sy), 00021 // its width and height, and its color. 00022 Tank(int sx, int sy, int width, int height, int color); 00023 00024 // Calculate the bounding box of your tank for collision checking. 00025 int min_x(void); 00026 int min_y(void); 00027 int max_x(void); 00028 int max_y(void); 00029 00030 // Calculate the position of the end of the barrel. 00031 void barrel_end(int* bx, int* by); 00032 00033 // Reposition the tank! 00034 void reposition(int dx, int dy, float dtheta); 00035 00036 // Draw the tank! 00037 void draw(); 00038 }; 00039 00040 #endif
Generated on Mon Jul 18 2022 22:47:15 by
1.7.2
