Shmup/src/shmup/player.h

59 lines
1.4 KiB
C
Raw Normal View History

#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"
2023-02-05 16:49:56 +01:00
#include "bonus.h"
class Player
{
public:
Player( int16_t _x, int16_t _y, uint8_t _id );
~Player();
void Update( float dt );
void Render( void );
2023-02-05 16:49:56 +01:00
bool Test_Impact( Bullet *projectile );
bool Test_Impact( Bonus *bonus );
2023-02-05 10:05:05 +01:00
bool Test_Collision( Enemy *adverseship );
void Set_Speed( uint8_t _sp );
2023-01-22 11:07:36 +01:00
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
2023-01-22 11:07:36 +01:00
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