Layering rendering now proper.

This commit is contained in:
2023-07-07 06:42:49 -05:00
parent 7348426c71
commit 6b81cd6e84
16 changed files with 189 additions and 116 deletions
+4 -2
View File
@@ -19,6 +19,7 @@ struct Bullet{
bool deactivated=false; //A deactivated bullet no longer interacts with the world. It's just a visual.
float fadeOutTime=0;
bool friendly=false; //Whether or not it's a player bullet or enemy bullet.
bool upperLevel=false;
private:
float fadeOutTimer=0;
void UpdateFadeTime(float fElapsedTime);
@@ -26,9 +27,9 @@ public:
Animate2D::Animation<AnimationState>animation;
Animate2D::AnimationState internal_animState;
std::map<Monster*,bool>hitList;
Bullet(vf2d pos,vf2d vel,float radius,int damage,bool friendly=false,Pixel col=WHITE);
Bullet(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,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,bool friendly=false,Pixel col=WHITE);
Bullet(vf2d pos,vf2d vel,float radius,int damage,AnimationState animation,bool upperLevel,bool hitsMultiple=false,float lifetime=INFINITE,bool rotatesWithAngle=false,bool friendly=false,Pixel col=WHITE);
public:
virtual void Update(float fElapsedTime);
//Return true when the bullet should be destroyed. Return false to handle it otherwise (like deactivating it instead). You become responsible for getting rid of the bullet.
@@ -37,4 +38,5 @@ public:
virtual bool MonsterHit(Monster&monster);
Animate2D::Frame GetFrame();
void Draw();
bool OnUpperLevel();
};