vladkomarr

collidingcomponent

Nov 29th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. // colliding between two entities
  2. if (lhs.colliding(rhs))
  3. {
  4.     ...
  5.     if (lhs->parent.hasComponent<Bullet>() && rhs->parent.hasComponent<Health>())
  6.     {
  7.         lhs->parent.onCollide();
  8.         rhs->parent.onCollide<Bullet>(int dhp);
  9.     }
  10. ..
  11. }
Advertisement
Add Comment
Please, Sign In to add comment