Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Rectangle


  public void fillRect(float x, float y, float width, float height,
      Image pattern, float offX, float offY) {
    int cols = ((int) Math.ceil(width / pattern.getWidth())) + 2;
    int rows = ((int) Math.ceil(height / pattern.getHeight())) + 2;

    Rectangle preClip = getWorldClip();
    setWorldClip(x, y, width, height);

    predraw();
    // Draw all the quads we need
    for (int c = 0; c < cols; c++) {
View Full Code Here


    // Hintergrund hinzufügen
    this.simulatedWorld.addBackground(new Drawable() {
      public void draw(Graphics g) {
        g.pushTransform();
        DemoLevel.this.simulatedWorld.doCameraTranslation(g);
         g.texture(new Rectangle(-50.0f, -40.0f, 200.0f, 60.0f), ResourceManager.getInstance().getImage("landscape.png"), true);
         g.popTransform();
      }
    });
   
    // Spielfigur
View Full Code Here

  public double getY() {
    return y;
  }
 
  public Rectangle getRect() {
    return new Rectangle((int)x, (int)y,
              image.getWidth(), image.getHeight());
  }
View Full Code Here

        setPlayerWalkRight(setAnimationFromSheet(sheet,rigaRight,startNumAnimazioni,numAnimazioni));
        setPlayerWalkDown(setAnimationFromSheet(sheet,rigaDown,startNumAnimazioni,numAnimazioni));
        setPlayerWalkLeft(setAnimationFromSheet(sheet,rigaLeft,startNumAnimazioni,numAnimazioni));

        // per gestione collisioni
    me = new Rectangle(x,y,ENTITY_SPRITE_SIZE,ENTITY_SPRITE_SIZE) ;       
  }
View Full Code Here

   * @param other The other entity to check collision against
   * @return True if the entities collide with each other
   */
  public boolean collidesWith(Entity other) {
   
    Rectangle him = other.me;
   
    me.setBounds((int) x*32,(int) y*32,ENTITY_SPRITE_SIZE/2,ENTITY_SPRITE_SIZE/2);
   
    him.setBounds((int) other.getX()*32,(int) other.getY()*32,other.ENTITY_SPRITE_SIZE/2,other.ENTITY_SPRITE_SIZE/2);
   
    return me.intersects(him);
  }
View Full Code Here

        setAnimAttackRight(setAnimationFromSheet(sheet,rigaAttackRight, startNumAnimazioniAttack,numAnimazioniAttack));
        setAnimAttackDown(setAnimationFromSheet(sheet,rigaAttackDown, startNumAnimazioniAttack,numAnimazioniAttack));       
        setAnimAttackLeft(setAnimationFromSheet(sheet,rigaAttackLeft, startNumAnimazioniAttack,numAnimazioniAttack));
       
        // per gestione collisioni
    me = new Rectangle(x,y,ENTITY_SPRITE_SIZE,ENTITY_SPRITE_SIZE) ;
   
  }
View Full Code Here

   * @param other The other entity to check collision against
   * @return True if the entities collide with each other
   */
  public boolean collidesWith(Entity other, float x, float y) {
   
    Rectangle him = other.me;
   
    Rectangle collision = new Rectangle(me.getX()+x,me.getY()+y,ENTITY_SPRITE_SIZE,ENTITY_SPRITE_SIZE);
   
    //me.setBounds( me.getX()+x, me.getY()+y,ENTITY_SPRITE_SIZE/2,ENTITY_SPRITE_SIZE/2);
   
    //him.setBounds( other.getX()*32 , other.getY()*32 ,other.ENTITY_SPRITE_SIZE/2,other.ENTITY_SPRITE_SIZE/2);
    if (collision.intersects(him)){
      this.collidedWith(other);
      return true;
    } else {
      return false;
    }
View Full Code Here

        setAnimAttackRight(setAnimationFromSheet(sheet,rigaAttackRight, startNumAnimazioniAttack,numAnimazioniAttack));
        setAnimAttackDown(setAnimationFromSheet(sheet,rigaAttackDown, startNumAnimazioniAttack,numAnimazioniAttack));       
        setAnimAttackLeft(setAnimationFromSheet(sheet,rigaAttackLeft, startNumAnimazioniAttack,numAnimazioniAttack));
       
        // per gestione collisioni
    me = new Rectangle(x,y,ENTITY_SPRITE_SIZE,ENTITY_SPRITE_SIZE) ;
   
  }
View Full Code Here

   * @param other The other entity to check collision against
   * @return True if the entities collide with each other
   */
  public boolean collidesWith(Entity other, float x, float y) {
   
    Rectangle him = other.me;
   
    Rectangle collision = new Rectangle(me.getX()+x,me.getY()+y,ENTITY_SPRITE_SIZE,ENTITY_SPRITE_SIZE);
   
    //me.setBounds( me.getX()+x, me.getY()+y,ENTITY_SPRITE_SIZE/2,ENTITY_SPRITE_SIZE/2);
   
    //him.setBounds( other.getX()*32 , other.getY()*32 ,other.ENTITY_SPRITE_SIZE/2,other.ENTITY_SPRITE_SIZE/2);
    if (collision.intersects(him)){
      this.collidedWith(other);
      return true;
    } else {
      return false;
    }
View Full Code Here

        setAnimWalkRight(setAnimationFromSheet(sheet,rigaRight,startNumAnimazioni,numAnimazioni));
        setAnimWalkDown(setAnimationFromSheet(sheet,rigaDown,startNumAnimazioni,numAnimazioni));
        setAnimWalkLeft(setAnimationFromSheet(sheet,rigaLeft,startNumAnimazioni,numAnimazioni));

        // per gestione collisioni
    me = new Rectangle(x,y,ENTITY_SPRITE_SIZE,ENTITY_SPRITE_SIZE) ;
   
  }
View Full Code Here

TOP

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

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.