Skip to content
Snippets Groups Projects
Select Git revision
  • 2488f9b13dacaeaa32893f28364ea4b25aedfd54
  • master default protected
2 results

LivingEntity.h

Blame
  • LivingEntity.h 673 B
    #pragma once
    #include "Entity.h"
    namespace entities {
    	class LivingEntity :
    		public Entity
    	{
    	private:
    		int health;
    		char direction;
    		char anim_phase;
    		float timeUntilNextPhase;
    		const static float phaseLength;
    	protected:
    		olc::vf2d getHitBoxSize() const override;
    		olc::vf2d speed;
    		virtual olc::vf2d collisionOffset(GameClient& client);
    		
    	public:
    		LivingEntity(olc::vf2d pos, int health = 512);
    		bool damage(int damage, Entity& attacker) override;
    		char getDirection();
    		char getAnimPhase() const;
    
    
    		void tick(GameClient& client, float deltaT, std::shared_ptr<Entity>& shared_this) override; //TODO
    
    		LivingEntity* getAsLivingEntity() override;
    	};
    }