@Override
 protected void processEntity(Entity entity, float deltaTime) {
   PlatformMonsterComp pm = entity.getComponent(PlatformMonsterComp.class);
   MonsterMovementComp mm = entity.getComponent(MonsterMovementComp.class);
   BodyComp b = entity.getComponent(BodyComp.class);
   Vector2 pos = b.body.getPosition();
   pos.x *= b.invWorldScale;
   pos.y *= b.invWorldScale;
   switch (mm.moveType) {
     case LEFT:
       if (pos.x <= pm.minX) {
         standMonster(pm, mm);
       }
       break;
     case STAND:
       if (pm.standCountdown > 0) {
         pm.standCountdown -= deltaTime;
       }
       if (pm.standCountdown <= 0) {
         pm.standCountdown = 0;
         if (pos.x <= pm.minX) {
           mm.moveType = MonsterMovementComp.MoveType.RIGHT;
         } else {
           mm.moveType = MonsterMovementComp.MoveType.LEFT;
         }
       }
       break;
     case RIGHT:
       if (pos.x >= pm.maxX) {
         standMonster(pm, mm);
       }
       break;
   }
 }
 @Override
 public void beginContact(Contact contact) {
   Entity monster = PhysicsSys.getEntityFromBodyData(UserData.Type.MONSTER, contact);
   if (monster != null) {
     MonsterComp m = monster.getComponent(MonsterComp.class);
     if (m.type == MonsterComp.Type.PLATFORM_MONSTER) {
       Entity wall = PhysicsSys.getEntityFromBodyData(UserData.Type.WALL, contact);
       if (wall != null) {
         Vector2 wallPos = getPos(wall);
         Vector2 monsterPos = getPos(monster);
         PlatformMonsterComp pm = monster.getComponent(PlatformMonsterComp.class);
         if (wallPos.x < monsterPos.x) {
           pm.minX = wallPos.x + 5f;
         } else {
           pm.maxX = wallPos.x - 5f;
         }
       }
     }
   }
 }
 private void standMonster(PlatformMonsterComp pm, MonsterMovementComp mm) {
   pm.standCountdown = pm.standInterval;
   mm.moveType = MonsterMovementComp.MoveType.STAND;
 }