Entity.h 406 B

123456789101112131415161718192021222324
  1. #ifndef ENTITY_H
  2. #define ENTITY_H
  3. #include "math/Vector.h"
  4. struct Entity {
  5. Vector2 lastPosition;
  6. Vector2 position;
  7. Vector2 size;
  8. Vector2 velocity;
  9. Vector2 acceleration;
  10. Vector2 force;
  11. float inverseMass;
  12. bool onGround;
  13. int jumpTicks;
  14. Entity(const Vector2& size, float mass);
  15. void addForce(const Vector2& force);
  16. void preTick();
  17. void tick();
  18. };
  19. #endif