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:
- DCchico
- Date:
- 2021-03-29
- Revision:
- 0:95264f964374
- Child:
- 1:4421c1e849e9
File content as of revision 0:95264f964374:
//=================================================================
// 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 struct {
int y; // The y-coordinate of knife current position
int height;
int score; // Current score
int knife_length;
boundingBox knife_boundingBox;
bool player_has_knife; // The knife status: 0->In the air 1->With Player
} PLAYER;
/** getter for user to acquire info without accessing structure
*/
PLAYER player_get_info(void);
/** Initialize all values in the PLAYER struct, then draw the player
*/
void player_init(void);
/** Check if player's current location is valid, then move the player
* "player.height" pixels up
*/
void player_moveUp(void);
/** Check if player's current location is valid, then move the player
* "player.height" pixels down
*/
void player_moveDown(void);
/** Throw knife by only by changing a value in the PLAYER struct
*/
void player_throw(void);
/** Check the status of the knife in the PLAYER struct and draw the knife
* accordingly
*/
void player_knife_draw(void);
/** Draw the player
*/
void player_draw(int color);
/** Reset knife's coordinates so that it comes back to the player's position,
* then redraw the knife
*/
void player_knife_return(void);
/** Increment the score by 1
*/
void player_score_inc(void);
#endif //PLAYER_PUBLIC_H