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 SDFileSystem mbed wave_player
Fork of missile_command by
player.h
00001 // Template of player header file 00002 #ifndef PLAYER_H 00003 #define PLAYER_H 00004 00005 // Player settings 00006 #define PLAYER_WIDTH 10 00007 #define PLAYER_HEIGHT 3 00008 #define PLAYER_DELTA 3 00009 #define PLAYER_COLOR 0x0000FF 00010 #define BLACK_COLOR 0x000000 00011 #define YELLOW_COLOR 0xFFFF00 00012 #define GREEN_COLOR 0x00FF00 00013 00014 00015 00016 00017 typedef enum { 00018 PLAYER_MISSILE_EXPLODED=2,///<missile has been destroyed 00019 PLAYER_MISSILE_ACTIVE=1,///<missile is active 00020 PLAYER_MISSILE_DEACTIVE=0///<missile is no longer active 00021 } PLAYER_MISSILE_STATUS; 00022 //Initialize ANTI-missile structure 00023 00024 typedef struct { 00025 int x; 00026 int origin_y; ///< The x-coordinate of missile current position 00027 int y; ///< The y-coordinate of missile current position 00028 int source_x; 00029 int source_y; 00030 PLAYER_MISSILE_STATUS status; ///< The missile status, see MISSILE_STATUS 00031 00032 } PLAYER_MISSILE; 00033 //Initialize PLAYER structure 00034 typedef struct { 00035 int x; 00036 int y; 00037 int numMissile; 00038 int lives; 00039 00040 00041 } PLAYER; 00042 //Declare functions 00043 void player_missile_draw(PLAYER_MISSILE player_missile, int color); 00044 void player_draw(int x, int y); 00045 void player_delete(int x, int y); 00046 void missile_start(int counter); 00047 void player_set_exploded(int index); 00048 void gameover(int s); 00049 00050 #endif //PLAYER_H
Generated on Wed Jul 13 2022 03:12:58 by
1.7.2
