Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Rectangle


    if (sameColor(topLeft, topRight)) {
      gradient = new GradientFill(x, y, convertToSlickColor(topLeft), x, y + height, convertToSlickColor(bottomLeft));
    } else {
      gradient = new GradientFill(x, y, convertToSlickColor(topLeft), x + width, y, convertToSlickColor(bottomRight));
    }
    Rectangle rect = new Rectangle(x, y, width, height);
    gameContainer.getGraphics().fill(rect, gradient);
  }
View Full Code Here


   
    protected final void performDefault()
    {
      hp = hp_default;
      x = Game.getAppX()+30+(new Random().nextInt(20));
      hitbox = new Rectangle(x-width, y-height, width, height); //setting hitbox
      hitbox_crit = new Rectangle(x-width+7, y-height+2, 9, 9);
      center = new Point(x-(float)width/2, y+(float)height/2);
      updateFacing();
    }
View Full Code Here

    hp = new HPBar();
    monster = new MonsterHandler(); //not a single monster, but a class controlling randomly generated monsters
    monster_controller = new MonsterWaveController();
    dispenser = new Dispenser();
    elements = new Elements();
    border = new Rectangle(-5,-5,Game.app_x+5,ground_level+47); //Bullet rectangle border
    background = new Background();
    scene_handler = new SceneHandler();
    sound_handler = new Sound();
   
    if (!Game.util_instantswitch)
View Full Code Here

        frame++;
        if (frame > 3)
          frame = 0;
      }
    }
    if (state != 0 && state != 3 && GameplayState.player.hitbox.intersects(new Rectangle(x, y, 10, 16)))
      onCollect();
    switch(state)
    {
    case 0:
    case 2:
View Full Code Here

      this.x = Game.getAppX()-width-10;
    }
    damage += type;
    speed -= type;
    util_speed = speed;
    zone = new Rectangle(this.x+5,GameplayState.ground_level+15,width+5,30);
   
    while(true)
    {
      if (light_anim.size() == 0)
      {
View Full Code Here

    util_img_chute = Util.loadImage("particle/parachute.png");
    util_img_chute_off[0] = Util.loadImage("particle/parachute_off_1.png");
    util_img_chute_off[1] = Util.loadImage("particle/parachute_off_2.png");
    util_img_chute_off[2] = Util.loadImage("particle/parachute_off_3.png");
    util_img_chute_off[3] = Util.loadImage("particle/parachute_off_4.png");
    hitbox = new Rectangle(x,y,30,30);
  }
View Full Code Here

 
  public BonusItem()
  {
    x = new Random().nextInt(Game.getAppX()-60)+30;
    y = -120;
    hitbox = new Rectangle(x,y,30,30);
  }
View Full Code Here

    if (!GameplayState.gamePaused())
      util_knife--;
    if (util_knife < 1)
    {
      util_knife = 0;
      Rectangle rect = new Rectangle(GameplayState.player.pl_center.getX()+(GameplayState.player.util_facing?20:-55), GameplayState.player.pl_center.getY()-30, 35, 60);
      Graphics g = Game.app.getGraphics();
      g.setLineWidth(1);
      g.setColor(Color.red);
      g.draw(rect);
      for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
      {
        Monster mob = MonsterHandler.monster_array.get(i);
        if ((rect.intersects(mob.hitbox) || rect.contains(mob.hitbox)) && mob.state != MS.DEAD && mob.state != MS.NULL)
        {
          util_knife = (byte) (40-Elements.extractLevel(ITEM.P_UPG_KNIFE)*5);
          Particle.addNew(PT.KNIFE, (int) GameplayState.player.pl_center.getX(), (int) GameplayState.player.pl_center.getY());
          mob.onDamage(25+Elements.extractLevel(ITEM.P_UPG_KNIFE)*8, true, false);
          break;
View Full Code Here

    for (int i = 0; i < list.size(); ++i)
    {
      MS mob_state = list.get(i).state;
      if (mob_state != MS.DEAD && mob_state != MS.NULL)
      {
        Rectangle mob_hitbox = list.get(i).hitbox; 
        for (float j = 0; j < radius; j += 3)
        {
          if (mob_hitbox.intersects(new Circle(x, y, j)) && mobNotDamaged(list.get(i), dmg_list))
          {
            float knockback = power; //calculate knockback
            knockback += (pc?2+pc_lvl:0);
            knockback += (th?4+th_lvl*0.8f:0);
            knockback += km_lvl*0.8f;
 
View Full Code Here

      //System.out.println("invincibiliy: " + invincible);
    }
  }
 
  public void horizontalPhysics(int delta, Chunk prevChunk, Chunk currChunk, Chunk nextChunk){
    Rectangle newMask = getNextMask((float)xSpeed*delta, 0f);
    CollisionGroup sideBlocks = getSideBlocks(prevChunk, currChunk, nextChunk, newMask);
    if (sideBlocks.bottomLeft.block == null || sideBlocks.bottomRight.block == null || sideBlocks.topLeft.block == null || sideBlocks.topRight.block == null){
      xSpeed = 0;
    }
    else
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.