Examples of Planet


Examples of com.barrybecker4.game.multiplayer.galactic.Planet

            String origin = model.getValueAt(i,ORIGIN_INDEX).toString();
            String dest = model.getValueAt(i,DESTINATION_INDEX).toString();
            int numShips = ((Integer)model.getValueAt(i, NUM_SHIPS_INDEX));

            Order o;
            Planet originPlanet = Galaxy.getPlanet(origin.charAt(0));
            Planet destPlanet = Galaxy.getPlanet(dest.charAt(0));

            if (i < numOldOrders) {
                Point2D currLoc = (lastOrders_.get(i)).getCurrentLocation();
                o = new Order(originPlanet, destPlanet, numShips, currLoc);
            }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.galactic.Planet

        int numOldOrders = lastOrders_.size();

        for (int i=numOldOrders; i<nRows; i++) {
            Character s = ((Character)model.getValueAt(i, ORIGIN_INDEX));
            Planet source = Galaxy.getPlanet(s);
            Integer numShips = ((Integer)model.getValueAt(i, NUM_SHIPS_INDEX));
            if (outgoingMap.get(source) != null) {
                Integer n = outgoingMap.get(source);
                outgoingMap.put(source, numShips+n);
            }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.galactic.Planet

    private void initPlanetSelect(JComboBox combo, GalacticPlayer player) {

        List planets =  Galaxy.getPlanets(player);
        String sPlanets[] = new String[planets.size()];
        for (int i=0; i<planets.size(); i++)  {
            Planet planet = (Planet)planets.get(i);
            sPlanets[i] = Character.toString(planet.getName());
        }
        ComboBoxModel comboModel = new DefaultComboBoxModel(sPlanets);
        combo.setModel(comboModel);
    }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.galactic.Planet

     * fill in the order properties based on specified field elements.
     * @return retrieve the specified order.
     */
    public Order getOrder() {

        Planet origin = getOrigin();
        Planet destination = getDestination();

        int fleetSize = getFleetSize();
        if (fleetSize > (origin.getNumShips() - getOutgoingShips(origin))) {
            JOptionPane.showMessageDialog(this, GameContext.getLabel("CANT_SEND_MORE_THAN_YOU_HAVE"));
            return null;
View Full Code Here

Examples of com.mlarktar.spacewar.sprites.Planet

      }
    }

    // Adds a planet in the middle of the screen   
    if (ngf.getUsePlanet() || ngf.getUseGravity()) {
      Planet planet =
        new Planet(
          (int) bounds.getCenterX(),
          (int) bounds.getCenterY(),
          ngf.getUsePlanet());
      space.addSpaceItem(planet, ngf.getUseGravity());
    }
View Full Code Here

Examples of com.orientechnologies.orient.test.domain.base.Planet

  }

  @Test(dependsOnMethods = "testEnumListWithCustomTypes")
  public void childUpdateTest() {
    OObjectDatabaseTx database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    Planet p = database.newInstance(Planet.class);
    Satellite sat = database.newInstance(Satellite.class);
    p.setName("Earth");
    p.setDistanceSun(1000);
    sat.setDiameter(50);
    p.addSatellite(sat);
    database.save(p);
    ORID rid = database.getIdentity(p);
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    p = database.load(rid);
    sat = p.getSatellites().get(0);
    Assert.assertEquals(sat.getDiameter(), 50);
    Assert.assertEquals(p.getDistanceSun(), 1000);
    Assert.assertEquals(p.getName(), "Earth");
    sat.setDiameter(500);
    // p.addSatellite(new Satellite("Moon", 70));
    // db.save(sat);
    database.save(p);
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    p = database.load(rid);
    sat = p.getSatellites().get(0);
    Assert.assertEquals(sat.getDiameter(), 500);
    Assert.assertEquals(p.getDistanceSun(), 1000);
    Assert.assertEquals(p.getName(), "Earth");
    database.close();
  }
View Full Code Here

Examples of game.finalTypes.Planet

  Planet mercury, mercury2, earth;
  Star sun;
  HashMap<Object, Object> solvedCollisions = new HashMap<Object, Object>(4);

  public void init() throws IOException {
    mercury = new Planet(2000, 5000);
    mercury.setPosition(new Vector(-20000, 0, -40000));
    //mercury.setRotation(new Vector(0, 0.02f, 0));
    Texture texMercury = TextureLoader.getTexture("JPG",
        ResourceLoader.getResourceAsStream("res/mercury.jpg"));
    mercury.setTexture(texMercury);
   
    mercury2 = new Planet(2000, 5000);
    mercury2.setPosition(new Vector(0, -5000, -40000));
    //mercury2.setRotation(new Vector(0, 0.01f, 0));
    mercury2.setTexture(texMercury);
   
    earth = new Planet(3000, 5000);
    earth.setPosition(new Vector(10000, 0, -40000))
    //earth.setRotation(new Vector(0, -0.006f, 0));
    Texture texEarth = TextureLoader.getTexture("JPG",
        ResourceLoader.getResourceAsStream("res/earth.jpg"))
    earth.setTexture(texEarth);
View Full Code Here

Examples of jodd.petite.tst5.Planet

  public void testProviderLookup() {
    PetiteContainer pc = new PetiteContainer();

    pc.registerPetiteBean(Solar3.class, null, null, null, false);

    Planet earth = (Planet) pc.getBean("planet");

    assertEquals("Earth", earth.toString());
  }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.api.galaxies.Planet

        this.registerTileEntities();
        this.registerCreatures();
        this.registerOtherEntities();

        MarsModule.planetMars = (Planet) new Planet("mars").setParentSolarSystem(GalacticraftCore.solarSystemSol).setRingColorRGB(0.67F, 0.1F, 0.1F).setPhaseShift(0.1667F).setRelativeSize(0.5319F).setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(1.25F, 1.25F)).setRelativeOrbitTime(1.8811610076670317634173055859803F);
        MarsModule.planetMars.setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/mars.png"));
        MarsModule.planetMars.setDimensionInfo(ConfigManagerMars.dimensionIDMars, WorldProviderMars.class).setTierRequired(2);
        MarsModule.planetMars.atmosphereComponent(IAtmosphericGas.CO2).atmosphereComponent(IAtmosphericGas.ARGON).atmosphereComponent(IAtmosphericGas.NITROGEN);

        GalaxyRegistry.registerPlanet(MarsModule.planetMars);
View Full Code Here

Examples of net.sf.fysix.world.Planet

      //
      // PLAYER 1
      //
      int shots = input1.checkEvent(InputAction.SHOOT);
      if (shots > 0) {
        WorldObject bullet = new Planet(2,50, TypeE.WEAPON_SHOT_MINE);
        Vector2d dir = new Vector2d(Math.cos(player1.getWorldObject().getRotation()), Math.sin(player1.getWorldObject().getRotation()));
        Vector2d pos = player1.getWorldObject().getPosition();
        pos.addScaled(16, dir);
        bullet.setPosition(pos);
        dir.scale(1000000);
        //bullet.setVelocity(dir);
        world.addObject(bullet, true);
        bullet.applyImpulse(dir);
        //dir.scale(-1);
        //playerShip.applyImpulse(dir);
      }
     
      //
      // PLAYER 2
      //
      shots = input2.checkEvent(InputAction.SHOOT);
      if (shots > 0) {
        WorldObject bullet = new Planet(2,50, TypeE.WEAPON_SHOT_MINE);
        Vector2d dir = new Vector2d(Math.cos(player2.getWorldObject().getRotation()), Math.sin(player2.getWorldObject().getRotation()));
        Vector2d pos = player2.getWorldObject().getPosition();
        pos.addScaled(16, dir);
        bullet.setPosition(pos);
        dir.scale(1000000);
        //bullet.setVelocity(dir);
        world.addObject(bullet, true);
        bullet.applyImpulse(dir);
      }
     
      // Advance the game time by one tick
      engine.tick(1.0 / tickRate);
      nextTick += NANOS_PER_SEC / tickRate;
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.