From Melodic Tortoise, 1 Month ago, written in Plain Text.
This paste will explode in 9 Months.
Embed
  1. int PhysicsSystem::moveLeft(Entity* e, float dt) {
  2.  
  3.     PositionComponent* posc = e->get<PositionComponent>();
  4.     PhysicsComponent* phyc = e->get<PhysicsComponent>();
  5.     if(posc && phyc) {
  6.         int deltaX = phyc->getXVel()*dt;
  7.         int x = posc->getX();
  8.         int y = posc->getY();
  9.         posc->setPos(x - deltaX, y);
  10.         return 1;
  11.     }
  12.  
  13.     return -1;
  14. }
  15.