Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Rectangle


   
  }
 
 
  public Rectangle getNextMask(float xs, float ys){
    return new Rectangle((float)(xPos+(width-maskWidth)/2) + xs, (float)(yPos+(height-maskHeight)/2) + ys, (float)(maskWidth), (float)maskHeight);
  }
View Full Code Here


    itemID = 1;
    width = 12;
    height = 12;
    maxAge = -1;
    age = 0;
    mask = new Rectangle((float)(this.x), (float)(yPos), (float)(width), (float)height);
    // TODO Auto-generated constructor stub
  }
View Full Code Here

    width = 12;
    maskWidth = 8;
    maskHeight = 8;
    hP = 100;
    maxHP = 100;
    mask = new Rectangle((float)(x+(getWidth()-maskWidth)/2), (float)(y+(getHeight()-maskHeight)/2), (float)maskWidth, (float)maskHeight);
    zIndex = -2;
  }
View Full Code Here

    gravity = 0.0006;
    facing = -1;
    type = BaddyType.PARASQUID;
    maskWidth = 14;
    maskHeight = 16;
    mask = new Rectangle((float)(x-maskWidth/2), (float)y, (float)(maskWidth), (float)maskHeight);
    standing = false;
    jumping = false;
    jumpSpacing = 1000;
    timeSinceJump = jumpSpacing + 1;
    maxJumps = 1;
View Full Code Here

  }
 
  public void fallingPhysics(int delta){
    ySpeed += gravity*delta;
    standing = false;
    Rectangle newMask = getMask(0, (float)ySpeed);
    if (ySpeed > 0){
      Block[] beneathBlocks = env.getBeneathBlocks(x, y, width);
      for (int i = 0; i < 3; i++){
        if (beneathBlocks[i] != null && beneathBlocks[i].solid && beneathBlocks[i].mask.getMinY() - newMask.getMinY() > 8
            && Utils.intersects(beneathBlocks[i].mask, newMask)){
          floating = false;
          ySpeed = 0;
          y = beneathBlocks[i].y - width;
          standing = true;
View Full Code Here

  }
 
 
  public void horizontalPhysics(int delta){
    Block[] sideBlocks = env.getSideBlocks(x, y, width);
    Rectangle newMask = getMask((float)xSpeed, 0f);
    if (xSpeed > 0){
      for (int i = 1; i < 6; i+=2){
        if (sideBlocks[i] != null && sideBlocks[i].solid && Utils.intersects(sideBlocks[i].mask, newMask)){
          xSpeed = 0;
          facing = -1;
View Full Code Here

    this.x = x;
    this.y = y;
   
    dead = false;
   
    mask = new Rectangle((float)(x), (float)(y), (float)BlockSand.WIDTH, (float)BlockSand.WIDTH);
  }
View Full Code Here

  @Override
  public void doLogic(int delta, Chunk prevChunk, Chunk currChunk, Chunk nextChunk) {
    // TODO Auto-generated method stub
    y = y+ySpeed*delta;
    mask = new Rectangle((float)(x), (float)(y), (float)BlockSand.WIDTH, (float)BlockSand.WIDTH);
    Block b2 = Utils.pointToBlock(x, y+16);
    if ((b2==null) || (b2.type != BlockType.air && b2.type != BlockType.water)){
      //Change current block to block sand
      Block b = new BlockSand();
      b.durability = durability;
View Full Code Here

    ySpeed = 0;
    speed = 0.2;
    maxAge = 1500;
    age = 0;
    baseDamage = 10;
    mask = new Rectangle((float)(xPos+(width-maskWidth)/2), (float)(yPos+(width-maskHeight)/2), (float)maskWidth, (float)maskHeight);
  }
View Full Code Here

   
  }
 
 
  public Rectangle getNextMask(float xs, float ys){
    return new Rectangle((float)(xPos+(width-maskWidth)/2) + xs, (float)(yPos+(height-maskHeight)/2) + ys, (float)(maskWidth), (float)maskHeight);
  }
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.