Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Vector2f


    for (int i=0; i < links.size(); i++) {
      XMLElement link = links.get(i);
     
      if (link.getName().equals("animLink")) {
        for (int j=0; j < link.getChildrenByName("frame").size(); j++) {
          result.add(new Vector2f(link.getChildrenByName("frame").get(j).getIntAttribute("u"), link.getChildrenByName("frame").get(j).getIntAttribute("v")));
        }
      } else {
        result.add(new Vector2f(link.getIntAttribute("u"), link.getIntAttribute("v")));
      }
    }
   
    //Convert to array.
    Vector2f[] array = new Vector2f[result.size()];
View Full Code Here


    timer -= delta;
  }
 
  public void render (Graphics g, float x, float y) {
    if (timer > 0) {
      drawSpeechBubble(g, speech, new Vector2f(x,y));
    }
  }
View Full Code Here

        onCollide,
        onUpdate,
        onEnter,
        onHurt,
        walkableTerrains,
        new Vector2f(phaseTag.getIntAttribute("drawFromX", 0),phaseTag.getIntAttribute("drawFromY", 0)),
        phaseTag.getBooleanAttribute("isSolid", false),
        phaseTag.getIntAttribute("layer", 1),
        phaseTag.getIntAttribute("moveSpeed", 25),
        phaseTag.getIntAttribute("animSpeed", phaseTag.getIntAttribute("moveSpeed", 25)*5),
        phaseTag.getIntAttribute("damage", 0),
View Full Code Here

      delay = new Integer(compiledTile.substring(2,6)).intValue();
     
      for (int i=0; i < images.length; i++) {
        int u = new Integer(compiledTile.substring(6+(i*4),8+(i*4))).intValue();
        int v = new Integer(compiledTile.substring(8+(i*4),10+(i*4))).intValue();
        images[i] = new Vector2f(u, v);
      }
     
      terrain = compiledTile.substring(6+(images.length*4));
    } else {
      delay = 1;
     
      images = new Vector2f[1];
      int u = new Integer(compiledTile.substring(0,2)).intValue();
      int v = new Integer(compiledTile.substring(2,4)).intValue();
      images[0] = new Vector2f(u, v);
     
      terrain = compiledTile.substring(4);
    }
  }
View Full Code Here

  public Prop( ArrayList<Animation> animations )
  {
    this.animations = animations;
    boundingBox = new BoundingBox(animations.get(0).getWidth(), animations.get(0).getHeight());
    position = new Vector2f();
    velocity = new Vector2f();
    acceleration = new Vector2f();
    mapIndexes = new LinkedList<Integer>();
    center = new Vector2f();
  }
View Full Code Here

  public Prop( Animation animation )
  {
    this.animations = new ArrayList<Animation>(1);
    this.animations.add(0, animation);
    boundingBox = new BoundingBox(animations.get(0).getWidth(), animations.get(0).getHeight());
    position = new Vector2f();
    velocity = new Vector2f();
    acceleration = new Vector2f();
    mapIndexes = new LinkedList<Integer>();
    center = new Vector2f();
  }
View Full Code Here

  public Prop( Color c, float width, float height, ArrayList<Animation> animations )
  {
    this.animations = animations;
    boundingBox = new BoundingBox(width, height, 0, 0, c);
    position = new Vector2f();
    velocity = new Vector2f();
    acceleration = new Vector2f();
    mapIndexes = new LinkedList<Integer>();
    center = new Vector2f();
  }
View Full Code Here

  public Prop( Color c, float width, float height, Animation animation )
  {
    this.animations = new ArrayList<Animation>(1);
    this.animations.add(animation);
    boundingBox = new BoundingBox(width, height, 0, 0, c);
    position = new Vector2f();
    velocity = new Vector2f();
    acceleration = new Vector2f();
    mapIndexes = new LinkedList<Integer>();
    center = new Vector2f();
  }
View Full Code Here

    public Jugador(final float x, final float y, final String imagen, final int width, final int height) {
        super(x * TAMANO_CASILLA, y * TAMANO_CASILLA, imagen);
        this.width = width;
        this.height = height;
        this.depth = 1;
        this.mySpeed = new Vector2f(4f, 4f);

        setHitBox(0, 37, this.width, this.height - 37);
        addType(PLAYER);
    }
View Full Code Here

  }

  /***************** some methods to deal with angles and vectors ************************************/

  public int getAngleToPosition(Vector2f otherPos) {
    Vector2f diff = otherPos.sub(new Vector2f(x, y));
    return (((int) diff.getTheta()) + 90) % 360;
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.geom.Vector2f

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.