Include flags for monsters and players to indicate if they are on the upper level or lower level.
This commit is contained in:
parent
7e5eb2335d
commit
4f6ac393ed
@ -1003,7 +1003,6 @@ MapName Crawler::GetCurrentLevel(){
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::cout<<std::endl<<"============"<<std::endl;
|
|
||||||
Crawler demo;
|
Crawler demo;
|
||||||
if (demo.Construct(WINDOW_SIZE.x, WINDOW_SIZE.y, 4, 4))
|
if (demo.Construct(WINDOW_SIZE.x, WINDOW_SIZE.y, 4, 4))
|
||||||
demo.Start();
|
demo.Start();
|
||||||
|
@ -79,6 +79,7 @@ struct Monster{
|
|||||||
AnimationState GetDeathAnimationName();
|
AnimationState GetDeathAnimationName();
|
||||||
bool hasHitPlayer=false;
|
bool hasHitPlayer=false;
|
||||||
bool canMove=true; //Set to false when stuck due to collisions.
|
bool canMove=true; //Set to false when stuck due to collisions.
|
||||||
|
bool upperLevel=false;
|
||||||
protected:
|
protected:
|
||||||
public:
|
public:
|
||||||
Monster()=delete;
|
Monster()=delete;
|
||||||
|
@ -50,6 +50,7 @@ struct Player{
|
|||||||
Animate2D::AnimationState internal_animState;
|
Animate2D::AnimationState internal_animState;
|
||||||
Key lastReleasedMovementKey;
|
Key lastReleasedMovementKey;
|
||||||
Key facingDirection;
|
Key facingDirection;
|
||||||
|
bool upperLevel=false;
|
||||||
void AddAnimation(AnimationState state);
|
void AddAnimation(AnimationState state);
|
||||||
void Update(float fElapsedTime);
|
void Update(float fElapsedTime);
|
||||||
void SetSwordSwingTimer(float val);
|
void SetSwordSwingTimer(float val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user