30 lines
843 B
C++
30 lines
843 B
C++
#pragma once
|
|
#include "olcPixelGameEngine.h"
|
|
#include "Animation.h"
|
|
#include "olcUTIL_Animate2D.h"
|
|
#include "Monster.h"
|
|
|
|
#define INFINITE 999999
|
|
|
|
struct Bullet{
|
|
vf2d pos;
|
|
vf2d vel;
|
|
float radius;
|
|
int damage;
|
|
Pixel col;
|
|
float lifetime=INFINITE;
|
|
bool hitsMultiple=false;
|
|
bool rotates=false;
|
|
bool animated=false;
|
|
Animate2D::Animation<AnimationState>animation;
|
|
Animate2D::AnimationState internal_animState;
|
|
std::map<Monster*,bool>hitList;
|
|
float lastParticleSpawn=0;
|
|
Bullet(vf2d pos,vf2d vel,float radius,int damage,Pixel col=WHITE);
|
|
//Initializes a bullet with an animation.
|
|
Bullet(vf2d pos,vf2d vel,float radius,int damage,AnimationState animation,bool hitsMultiple=false,float lifetime=INFINITE,bool rotatesWithAngle=false,Pixel col=WHITE);
|
|
public:
|
|
void Update(float fElapsedTime);
|
|
Animate2D::Frame GetFrame();
|
|
void Draw();
|
|
}; |