Examples of Ship


Examples of com.artemis.reference.Ship

  @Test
  public void test_resolving_entity_factory() {
    World w = new World();
    w.initialize();
   
    Ship shipFactory = w.createFactory(Ship.class);
    assertNotNull(shipFactory);
    assertEquals(ShipImpl.class, shipFactory.getClass());
   
    Entity e = shipFactory.create();
    Entity e2 = shipFactory.create();
   
    // 1 is an entity with zero components.
    assertEquals(2, e.getCompositionId());
    assertEquals(2, e2.getCompositionId());
   
View Full Code Here

Examples of com.artemis.reference.Ship

  @Test
  public void test_sticky_and_per_instance() {
    World w = new World();
    w.initialize();
   
    Ship shipFactory = w.createFactory(Ship.class);
    assertNotNull(shipFactory);
    assertEquals(ShipImpl.class, shipFactory.getClass());
   
    shipFactory.hitPoints(100);
   
    Entity e1 = shipFactory.size(10, 20).create();
    Entity e2 = shipFactory.create();
   
    assertEquals(10, e1.getComponent(Size.class).width, 0.001f);
    assertEquals(20, e1.getComponent(Size.class).height, 0.001f);
    assertEquals(100, e1.getComponent(HitPoints.class).hitpoints);
    assertEquals(0, e2.getComponent(Size.class).width, 0.001f);
View Full Code Here

Examples of com.artemis.reference.Ship

  @Test
  public void test_update_sticky() {
    World w = new World();
    w.initialize();
   
    Ship shipFactory = w.createFactory(Ship.class);
    Entity e1 = shipFactory.hitPoints(100).create();
    Entity e2 = shipFactory.copy().hitPoints(200).create();
   
    assertEquals(100, e1.getComponent(HitPoints.class).hitpoints);
    assertEquals(200, e2.getComponent(HitPoints.class).hitpoints);
  }
View Full Code Here

Examples of com.artemis.reference.Ship

  @Test(expected=RuntimeException.class)
  public void test_fail_on_sticky_update_after_creation() {
    World w = new World();
    w.initialize();
   
    Ship shipFactory = w.createFactory(Ship.class);
    assertNotNull(shipFactory);
    assertEquals(ShipImpl.class, shipFactory.getClass());
   
    shipFactory.hitPoints(100).create();
    shipFactory.hitPoints(200).create();
  }
View Full Code Here

Examples of com.artemis.reference.Ship

  @Test
  public void test_fluent_api_test() {
    World w = new World();
    w.initialize();
   
    Ship fac = w.createFactory(Ship.class);
    fac.hitPoints(20).tag("hello").size(20, 10);
    fac.hitPoints(20).group("hello").size(20, 10).tag("hello");
  }
View Full Code Here

Examples of com.mlarktar.spacewar.sprites.Ship

    space.addSpaceItem(new CrazyPoly(getX(7, 1), getY(3), true, true));
    space.addSpaceItem(new CrazyPoly(getX(7, 2), getY(3), false, true));
    space.addSpaceItem(new CrazyPoly(getX(7, 2), getY(4), true, true));
   
    // add ship and victories by each ship
    Ship ship = new Ship(bounds.width / 4, bounds.height * 2 / 3, space);
    ship.setRepresentation(new DeffensiveRepresentation());
    space.addSpaceItem(ship);
    ship = new Ship(bounds.width * 3 / 4, bounds.height * 2 / 3, space);
    ship.setRepresentation(new OffensiveRepresentation());
    space.addSpaceItem(ship);
   
    // add the equal sign and the number of victories for each ship
    ScrollingText text = new ScrollingText(" = " + app.getShipVictories(0), bounds.width / 4 + Ship.SHIPSIZE, bounds.height * 2 / 3 + Ship.SHIPSIZE);
    text.setAboutFont(new Font("Monospaced", Font.BOLD, 20));
View Full Code Here

Examples of com.mlarktar.spacewar.sprites.Ship

        i.remove();
      }
      // doesnt hyper if it is about to collide with a weaker
      // ship. :P
      if (si instanceof Ship) {
        Ship siship = (Ship) si;
        if (siship.getShieldLevel() < ship.getShieldLevel()) {
          i.remove();
        }
      }
    }
View Full Code Here

Examples of com.mlarktar.spacewar.sprites.Ship

    int unity = bounds.height / 10;
    int unitx = bounds.width / 10;

    // Add the two ships to space
    if (ngf.getShip1Pilot() == NewGame.PILOTHUMAN) {
      ship1 = new Ship(unitx * 2, unity * 2, space);
    } else {
      ship1 = new ShipAI(unitx * 2, unity * 2, space);
    }

    if (ngf.getShip2Pilot() == NewGame.PILOTHUMAN) {
      ship2 =
        new Ship(
          bounds.width - unitx * 2,
          bounds.height - unity * 2,
          space);
    } else {
      ship2 =
View Full Code Here

Examples of com.palepail.TestGame.Model.Ship

  int counter = 0;
  Level level;

  public World(TestGame game, Level level) {
    this.game = game;
    ship = new Ship(new Vector2(10 * Configuration.gameScale, 3 * Configuration.gameScale),
        .4f * Configuration.gameScale, .4f * Configuration.gameScale, 0, 4f * Configuration.gameScale, 1,
        new InfoBox());
    ship.setDamage(ship.getBaseDamage());
    this.level = level;

View Full Code Here

Examples of com.riley.angrymasons.Model.Ship

  Bullet b;
  Enemy e;
 
  public World (AngryMasons game){
    this.game = game;
    ship = new Ship(new Vector2(5, 5), 1, 1, 0, 5f);
    enemies.add(new Follower(5f, 0, 1, 1, new Vector2(10, 10)));
    Gdx.input.setInputProcessor(new InputHandler(this));
  }
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.