add movement.*

This commit is contained in:
aozhiwei 2019-06-07 21:38:15 +08:00
parent 5af648f6c0
commit 3854633a19
3 changed files with 14 additions and 5 deletions

View File

@ -23,10 +23,6 @@ class Bullet : public Entity
Vector2D born_pos; Vector2D born_pos;
Vector2D born_dir; Vector2D born_dir;
float fly_distance = 0.0f; float fly_distance = 0.0f;
#ifdef RAY_DETECTION
float target_distance = 0.0f;
Vector2D target_point;
#endif
Bullet(); Bullet();
virtual ~Bullet() override; virtual ~Bullet() override;
@ -50,5 +46,4 @@ class Bullet : public Entity
private: private:
CircleCollider* self_collider_ = nullptr; CircleCollider* self_collider_ = nullptr;
}; };

View File

View File

@ -0,0 +1,14 @@
#pragma once
class Entity;
class MovementComponent
{
public:
Entity* owner = nullptr;
#ifdef RAY_DETECTION
float target_distance = 0.0f;
Vector2D target_point;
std::set<Entity*> detection_objects;
#endif
};