Bounce collisions occur between units.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
#include "olcPixelGameEngine.h"
|
||||
#include "Animation.h"
|
||||
#include "State.h"
|
||||
#include "Player.h"
|
||||
#include "olcUTIL_Animate2D.h"
|
||||
|
||||
enum MonsterStrategy{
|
||||
@@ -42,11 +44,17 @@ struct MonsterData{
|
||||
struct Monster{
|
||||
private:
|
||||
vf2d pos;
|
||||
vf2d vel={0,0};
|
||||
float friction=400;
|
||||
vf2d target={0,0};
|
||||
float targetAcquireTimer=0;
|
||||
int hp,maxhp;
|
||||
int atk;
|
||||
float moveSpd;
|
||||
float size;
|
||||
Key facingDirection;
|
||||
MonsterStrategy strategy;
|
||||
State state=State::NORMAL;
|
||||
Animate2D::Animation<AnimationState>animation;
|
||||
Animate2D::AnimationState internal_animState;
|
||||
float randomFrameOffset=0.f;
|
||||
@@ -67,6 +75,14 @@ struct Monster{
|
||||
//Returns true when damage is actually dealt (there is a death check here.)
|
||||
bool Hurt(int damage);
|
||||
bool IsAlive();
|
||||
vf2d&GetTargetPos();
|
||||
Key GetFacingDirection();
|
||||
void Draw();
|
||||
void Collision(Player&p);
|
||||
void Collision(Monster&p);
|
||||
void Collision();
|
||||
void SetVelocity(vf2d vel);
|
||||
void SetPosition(vf2d pos);
|
||||
};
|
||||
|
||||
struct MonsterSpawner{
|
||||
|
||||
Reference in New Issue
Block a user