Examples of Bullet


Examples of fr.umlv.escapeir.model.element.Bullet

    /**
     * Test if a player bullet hit an ennemy
     */
    if(contact.getFixtureA().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureB().getFilterData().categoryBits == Category.ENNEMY.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureB().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureA().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.ENNEMY.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
   
   
    /**
     * Test if ennemy bullet hit the player
     */
    if(contact.getFixtureB().getFilterData().categoryBits == Category.ENNEMY_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.PLAYER.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.ENNEMY_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.PLAYER.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
   
    /**
     * Test if bullet hit a boss
     */
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.BOSS.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
    if(contact.getFixtureB().getFilterData().categoryBits == Category.PLAYER_BULLET.getValue() && contact.getFixtureA().getFilterData().categoryBits == Category.BOSS.getValue()){
      AbstractShip ship = (AbstractShip) contact.getFixtureA().getBody().getUserData();
      Bullet bullet = (Bullet) contact.getFixtureB().getBody().getUserData();
      ship.isHit(bullet);
      bullet.hit();
    }
   
    /**
     * Test if ennemy hit the player
     */
 
View Full Code Here

Examples of game.entities.Bullet

    double offsetTheta, newX, newY;
   
    switch(weapon) {
    case PISTOL:
      bullets.add(
          new Bullet(parent.x, parent.y,
          weapon.shotSize, weapon.shotSize, Color.CYAN, approxDest.x,
          approxDest.y,  weapon.shotSpeed, parent));
   
      break;
    case SHOTGUN:
      offsetTheta = Math.toRadians(20);
      //System.out.println("DIST FROM DEST: " + distFromDest);
      for(int i = -1; i <= 1; i++) {
        newX = (distFromDest * Math.cos(origAngle + offsetTheta*i));
        newY =  -(distFromDest * Math.sin(origAngle + offsetTheta*i));
        //System.out.print("X: " + x + " Y: " + y);
        //System.out.println("DIST FROM DEST: " + distFromDest);
        bullets.add(
            new Bullet(parent.x, parent.y,
            weapon.shotSize, weapon.shotSize, Color.RED,(int)
            newX + parent.x,
            (int)newY + parent.y, weapon.shotSpeed, parent));
      }
      break;
    case FRAG_GRENADE:
      offsetTheta = Math.toRadians(15);
      for(int i = 0; i < 24; i++) {
        newX = (distFromDest * Math.cos(origAngle + offsetTheta*i));
        newY =  (distFromDest * Math.sin(origAngle + offsetTheta*i));
        bullets.add(
            new Bullet(parent.x, parent.y,
            weapon.shotSize, weapon.shotSize, Color.BLUE,
            (int)newX + parent.x,
            (int)newY + parent.y, weapon.shotSpeed,  parent));
      }
     
View Full Code Here

Examples of jnibwapi.model.Bullet

      ArrayList<Unit> enemyList = new ArrayList<Unit>();
      ArrayList<Unit> neutralList = new ArrayList<Unit>();
     
      for (int index = 0; index < bulletData.length; index += Bullet.numAttributes) {
        int id = bulletData[index];
        Bullet bullet = bullets.get(id);
        if (bullet == null) {
          bullet = new Bullet(id);
          bullets.put(id, bullet);
        }
        bullet.update(bulletData, index);
      }

      for (int index = 0; index < unitData.length; index += Unit.numAttributes) {
        int id = unitData[index];
View Full Code Here

Examples of obj.Bullet

    return perso;
  }

  @Override
  public void fire(){
    elements.add(new Bullet(perso.getX(), perso.getZ(), perso.getDir()));
  }
View Full Code Here

Examples of org.eclipse.swt.custom.Bullet

        public void lineGetStyle(LineStyleEvent e)
        {
            StyleRange style = new StyleRange();
            style.metrics = new GlyphMetrics(0, 0, Integer.toString(100000).length()*5);

        e.bullet = new Bullet(ST.BULLET_DOT, style);
      }
    });

    inputCmd.addControlListener(new ControlAdapter() {
      @Override
View Full Code Here

Examples of org.eclipse.swt.custom.Bullet

      messageText = messageText
          + UIText.CloneFailureDialog_checkList_https;
      bullets += 1;
    }
    int newLinesCount = messageText.split("\n").length; //$NON-NLS-1$
    Bullet bullet = createBullet(main);

    text.setText(messageText);
    text.setLineBullet(newLinesCount - bullets, bullets, bullet);

    return main;
View Full Code Here

Examples of org.eclipse.swt.custom.Bullet

  private Bullet createBullet(Composite main) {
    StyleRange style = new StyleRange();
    style.metrics = new GlyphMetrics(0, 0, 40);
    style.foreground = main.getDisplay().getSystemColor(SWT.COLOR_BLACK);
    Bullet bullet = new Bullet(style);
    return bullet;
  }
View Full Code Here

Examples of org.eclipse.swt.custom.Bullet

    display.syncExec(new Runnable() {
      public void run() {
        StyledText t = styledText.widget;
        StyleRange style = new StyleRange();
        style.metrics = new GlyphMetrics(0, 0, 1);
        t.setLineBullet(1, 1, new Bullet(style));
      }
    });

    assertTrue(styledText.hasBulletOnCurrentLine());
  }
View Full Code Here

Examples of org.htmlparser.tags.Bullet

    }

    public Tag createTag(TagData tagData, CompositeTagData compositeTagData)
        throws ParserException
    {
        return new Bullet(tagData, compositeTagData);
    }
View Full Code Here

Examples of org.htmlparser.tags.Bullet

        NodeList nestedBulletLists =
            ((CompositeTag) node[0]).searchFor(BulletList.class);
        assertEquals("bullets in first list", 2, nestedBulletLists.size());
        BulletList firstList = (BulletList) nestedBulletLists.elementAt(0);
        Bullet firstBullet = (Bullet) firstList.childAt(0);
        Node firstNodeInFirstBullet = firstBullet.childAt(0);
        assertType(
            "first child in bullet",
            StringNode.class,
            firstNodeInFirstBullet);
        assertStringEquals(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.