finished p2-2

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

player_public.h

Committer:
levelsnake3
Date:
2021-04-26
Revision:
2:7abebe259d59
Parent:
1:05e3f86df6d5

File content as of revision 2:7abebe259d59:

//=================================================================
// 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 id;
    int kPos;
    int PHK;    // The knife status: 0->In the air 1->With Player
    boundingBox kbb;
}KNIFE;

typedef struct {
    int score;                  // Current score         
    int lives;
    int combo;
    int misses;
    int y;
    KNIFE knife[2];
} PLAYER;

typedef void (*DrawFunc)(boundingBox b);

void miss(void);
void hurt(void);
bool dead(int n );

/** 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);
int returnMiss(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);

KNIFE getKnifeInfo(int n);
/** Reset knife's coordinates so that it comes back to the player's position,
 *  then redraw the knife 
 */
void player_knife_return(int n);

/** Increment the score by 1
 */
void player_score_inc(int n);

void knifeInit(int n);
int returnKnife(int n);
int getLives(void);
void knifeInit(int n);
void activeKnife(int n, int a);
void doReturnK(int n, int m);
#endif //PLAYER_PUBLIC_H