2023-06-16 01:41:38 -05:00
|
|
|
#pragma once
|
|
|
|
#include "olcPixelGameEngine.h"
|
2023-06-20 19:13:45 -07:00
|
|
|
#include "Animation.h"
|
|
|
|
#include "olcUTIL_Animate2D.h"
|
|
|
|
#include "Monster.h"
|
2023-06-16 01:41:38 -05:00
|
|
|
|
2023-06-24 02:14:11 -07:00
|
|
|
#define INFINITE 999999
|
|
|
|
|
2023-06-16 01:41:38 -05:00
|
|
|
struct Bullet{
|
|
|
|
vf2d pos;
|
|
|
|
vf2d vel;
|
|
|
|
float radius;
|
|
|
|
int damage;
|
|
|
|
Pixel col;
|
2023-06-24 02:14:11 -07:00
|
|
|
float lifetime=INFINITE;
|
2023-06-20 19:13:45 -07:00
|
|
|
bool hitsMultiple=false;
|
|
|
|
bool rotates=false;
|
|
|
|
bool animated=false;
|
|
|
|
Animate2D::Animation<AnimationState>animation;
|
|
|
|
Animate2D::AnimationState internal_animState;
|
|
|
|
std::map<Monster*,bool>hitList;
|
2023-06-16 01:41:38 -05:00
|
|
|
Bullet(vf2d pos,vf2d vel,float radius,int damage,Pixel col=WHITE);
|
2023-06-20 19:13:45 -07:00
|
|
|
//Initializes a bullet with an animation.
|
2023-06-24 02:14:11 -07:00
|
|
|
Bullet(vf2d pos,vf2d vel,float radius,int damage,AnimationState animation,bool hitsMultiple=false,float lifetime=INFINITE,bool rotatesWithAngle=false,Pixel col=WHITE);
|
2023-06-20 19:13:45 -07:00
|
|
|
public:
|
2023-06-30 15:44:41 -07:00
|
|
|
virtual void Update(float fElapsedTime);
|
2023-06-20 19:13:45 -07:00
|
|
|
Animate2D::Frame GetFrame();
|
|
|
|
void Draw();
|
2023-06-16 01:41:38 -05:00
|
|
|
};
|