Shmup/src/shmup/player.h

59 lines
1.4 KiB
C++

#ifndef PLAYER_H
#define PLAYER_H
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include "bullet.h"
#include "enemy.h"
#include "bonus.h"
class Player
{
public:
Player( int16_t _x, int16_t _y, uint8_t _id );
~Player();
void Update( float dt );
void Render( void );
bool Test_Impact( Bullet *projectile );
bool Test_Impact( Bonus *bonus );
bool Test_Collision( Enemy *adverseship );
void Set_Speed( uint8_t _sp );
bool Shoot_OK( uint32_t tempshoot, uint8_t shootID );
void Go_Left( float dt );
void Go_Right( float dt );
void Go_Up( float dt );
void Go_Down( float dt );
libnum::num x, y; // center position of the player
uint8_t width, height; // width and height -for the hitbox
int16_t xmin, xmax, ymin, ymax; // square hitbox (to speed up the bullet impact calculations)
uint8_t ID;
int16_t life;
uint8_t speed; // speed of the player
uint32_t lastshoot0 = 0;
uint32_t lastshoot1 = 0;
uint32_t lastshoot2 = 0;
bool satellites;
uint8_t satLevel;
uint8_t satNumber;
uint8_t satSpeed;
private:
float satAngle;
uint8_t satRadius;
};
#endif