Package com.mlarktar.spacewar.sprites

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


        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

    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

TOP

Related Classes of com.mlarktar.spacewar.sprites.Ship

Copyright © 2018 www.massapicom. 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.