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 wave_player 4DGL-uLCD-SE MMA8452
player_public.h
- Committer:
- lwills
- Date:
- 2020-06-24
- Revision:
- 0:09aa1ecd6c39
- Child:
- 1:5724f2947554
File content as of revision 0:09aa1ecd6c39:
//=================================================================
// The header file is for module "player"
//
// Copyright 2020 Georgia Tech. All rights reserved.
// The materials provided by the instructor in this course are for
// the use of the students currently enrolled in the course.
// Copyrighted course materials may not be further disseminated.
// This file must not be made publicly available anywhere.
//==================================================================
#ifndef PLAYER_PUBLIC_H
#define PLAYER_PUBLIC_H
#include "doubly_linked_list.h"
typedef enum {
PMISSILE_EXPLODED = 0,
PMISSILE_ACTIVE = 1
} PLAYER_MISSILE_STATUS; // is missile active or exploded?
typedef struct {
int x; /// The x-coordinate of missile current position
int y; /// The y-coordinate of missile current position
PLAYER_MISSILE_STATUS status; /// The missile status, see PLAYER_MISSILE_STATUS
} PLAYER_MISSILE;
typedef enum {
ALIVE = 1,
DESTROYED = 0
} PLAYER_STATUS; // is player aircraft alive or destroyed?
typedef struct {
int x; int y; // x,y-coordinate of player - top left pixel
int delta; // delta x,y
int width; int height;
PLAYER_STATUS status;
DLinkedList* playerMissiles;
} PLAYER; // structure for player
PLAYER player_get_info(void);
void player_init(void); // initialize the player's attributes
void player_moveLeft(void); // move delta pixels to the left
void player_moveRight(void); // move delta pixels to the right
void player_fire(void); // fire missiles
void player_missile_draw(void); // updates the drawing of missiles on screen
void player_draw(int color);
//void player_missile_exploded(int i);
//void player_missile_exploded(PLAYER_MISSILE *playerMissile); //method overload
void player_destroy(void); // destroy the player to end game
#endif //PLAYER_PUBLIC_H