Examples of Star


Examples of net.itscrafted.entity.Star

    stars = new Star[LevelData.MAX_LEVELS][3];
    int[] info = LevelData.getStars();
    for(int i = 0; i < stars.length; i++) {
      for(int j = 0; j < stars[0].length; j++) {
        if(j < info[i]) {
          stars[i][j] = new Star(480 + 40 * j, 114 + 35 * i, true);
        }
        else {
          stars[i][j] = new Star(480 + 40 * j, 114 + 35 * i, false);
        }
      }
    }
   
    // show mouse cursor
View Full Code Here

Examples of rtype.entity.Star

    starDeltaacc += Prototyp.tick ;
    if (starDeltaacc > starSpawningRate)
      {
        starDeltaacc = 0;
        starType = Prototyp.random.nextInt(6) + 11;
        spawningStar = new Star(starType);
        spawningStar.spawn(new Vector2f(Prototyp.SCREEN_WIDTH/2+10,Prototyp.random.nextInt() % Prototyp.SCREEN_HEIGHT/2),defaultStarSpeed,Prototyp.background);
      }
  }
View Full Code Here

Examples of rtype.entity.Star

         
        //    /*
          trash = new SpaceTrash(IEntity.SPACE_TRASH_1);
          trash.spawn(new Vector2f(5,8),new Vector2f(-70.3f,0),2f,Prototyp.frontground);

          Star star = new Star(IEntity.STAR_1);
          star.spawn(new Vector2f(60f,-100),new Vector2f(-34.3f,0),Prototyp.background);
        
         
          star = new Star(IEntity.STAR_2);
          star.spawn(new Vector2f(60f,-120),new Vector2f(-30.3f,0),Prototyp.frontground);
         
         
          star = new Star(IEntity.STAR_3);
          star.spawn(new Vector2f(60f,-140),new Vector2f(-25.3f,0),Prototyp.background);
         
         
          star = new Star(IEntity.STAR_4);
          star.spawn(new Vector2f(360f,-160),new Vector2f(-20.3f,0),Prototyp.frontground);
         
         
          star = new Star(IEntity.STAR_5);
          star.spawn(new Vector2f(360f,-180),new Vector2f(-15.3f,0),Prototyp.background);
         
         
          star = new Star(IEntity.STAR_6);
          star.spawn(new Vector2f(360f,-200),new Vector2f(-50.3f,0),Prototyp.frontground);
         
         
         
          trash = new SpaceTrash(IEntity.SPACE_TRASH_2);
          trash.spawn(new Vector2f(250,20),new Vector2f(-40.3f,0),Prototyp.background);
View Full Code Here

Examples of views.Star

  private EquatorialCoordinates c;
 
  @Override
  public void read(BufferedReader reader, StarStorage stars) throws IOException {
    String line;
    Star s;
    while ((line = reader.readLine()) != null) {
      s = readLine(line);
      if (s != null)
        stars.add(s);
    }
View Full Code Here

Examples of views.Star

 
  public Star readLine(String line) {
    if (line.charAt(0) != '#') {
      subline = line.split(",");
      c = new EquatorialCoordinates(Double.parseDouble(subline[1]), Double.parseDouble(subline[2]));
      return new Star(subline[0], c, Double.parseDouble(subline[3]), subline[4]);
    }
    return null;
  }
View Full Code Here

Examples of views.Star

 
  @Override
  public void read(BufferedReader reader, StarStorage stars) throws IOException {
    String line;
    Star s;
    while ((line = reader.readLine()) != null) {
      s = readLine(line);
      if (s != null)
        stars.add(s);
    }
View Full Code Here

Examples of views.Star

      if (!datalineMatch.matches())
        return null;
      try {
        c = new EquatorialCoordinates(Coordinates.HoursMinutesSecondsToRadians(pipeTakeFirst(datalineMatch.group(3))),
                        Coordinates.DegreesMinutesSecondsToRadians(pipeTakeFirst(datalineMatch.group(4))));
        return new Star(datalineMatch.group(1),
                c,
                Double.parseDouble(datalineMatch.group(5)),
                spectralType(datalineMatch.group(2)));
      } catch (NumberFormatException e) {
        Messages.addError("Error while reading database : line "+line+" is malformed.");
View Full Code Here

Examples of views.Star

   * @param b
   * @return
   */
  @Override
  public double get(Astre a, Astre b) {
    Star s1 = (Star) a;
    Star s2 = (Star) b;
    return Math.abs(s1.getMagnitude() - s2.getMagnitude());
  }
View Full Code Here

Examples of views.Star

    if (!sm.mapBounds.contains(mousePosition))
      return;
    if (mousePosition == null)
      return;
   
    Star nearestStar = Helper.getNearestStarFromPosition(mousePosition);
   
    // may be null when no stars are loaded or visible
    if (nearestStar != null) {
      // get point and text
      Point ttPos = nearestStar.getPoint();
      String line1 = nearestStar.getName();
      String line2 = nearestStar.getCoodinates().toString();
      String line3 = "Magnitude : " + nearestStar.getMagnitude();
      String line4 = "Type spectral : " + nearestStar.getSpectralType();
 
      sm.drawToolTip(ttPos,
              PanelsFactory.createToolTip("<html>" + line1 + "<br/>" + line2 + "<br/>" + line3 + "<br/>" + line4 + "<br/></html>",
                            nearestStar.getColor().brighter().brighter()));
    }
  }
View Full Code Here

Examples of views.Star

  protected static Star getNearestStarFromPosition(Point position) {
  // Algorithme ultra naif
      StarStorage st = Stars.getStars();
      double dist;
      double min = Double.MAX_VALUE;
      Star nearestStar = null;

      for (Star currentStar : st)
        if (currentStar.getPoint() != null) { // l'étoile est visible
          dist = position.distance(currentStar.getPoint());
          if(min > dist){
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.