Package org.newdawn.slick

Examples of org.newdawn.slick.Animation$Frame


        img[i] = Util.loadImage("particle/light/light_corner_000"+i+".png").getFlippedCopy(flip, false);
        img[i].setAlpha(0.6f+(0.15f/6*damage));
        img[i].getScaledCopy(1.0f+(1.5f/((1/speed)*7)));
       
      }
      return new Animation(img, 240, true);
    }
View Full Code Here


      {
        img[i] = Util.loadImage("particle/light/light_000"+i+".png");
        img[i].setAlpha(0.6f+(0.25f/10*damage));
        img[i].getScaledCopy(1.0f+1.5f-(1.5f/30*(1/speed))+rand);
      }
      Animation anim = new Animation(img, 240, true);
      anim.setCurrentFrame(new Random().nextInt(5));
      return anim;
    }
View Full Code Here

 
  public void render(Graphics g)
  {
    for (int i = 0; i < light_anim.size(); ++i)
    {
      Animation anim = light_anim.get(i);
      anim.draw(x-width/2+(i==0?9:9+i*5), GameplayState.ground_level+19+(i==0||i==light_anim.size()-1?0:11));
    }
  }
View Full Code Here

      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    anim = new Animation(false);
    for (int i = 0; i<ss.length; i++){
      anim.addFrame(ss[i], 80);
    }
    anim.setLooping(true);
    anim.start();
View Full Code Here

        }
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
    anim = new Animation(false);
    for (int i = 0; i<ss.length; i++){
      anim.addFrame(ss[i], 90);
    }
    anim.setLooping(true);
    anim.start();
View Full Code Here

    private static Animation highlightedFireFighterDepartmentAnimation;
    private static Animation genericEmergencyAnimation;

    public static Animation getAmbulanceAnimation() {
        if (ambulanceAnimation == null) {
            ambulanceAnimation = new Animation();
            ambulanceAnimation.setLooping(false);
            ambulanceAnimation.setAutoUpdate(false);

            for (int row = 0; row < getAmbulanceSpriteSheet().getHorizontalCount(); row++) {
                for (int frame = 0; frame < getAmbulanceSpriteSheet().getVerticalCount(); frame++) {
View Full Code Here

        return ambulanceAnimation;
    }

    public static Animation getHighlightedHospitalAnimation() {
        if (highlightedHospitalAnimation == null) {
            highlightedHospitalAnimation = new Animation();
            highlightedHospitalAnimation.setLooping(true);
            highlightedHospitalAnimation.setAutoUpdate(true);

            for (int row = 0; row < getHighlightedHospitalSpriteSheet().getHorizontalCount(); row++) {
                for (int frame = 0; frame < getHighlightedHospitalSpriteSheet().getVerticalCount(); frame++) {
View Full Code Here

        return highlightedHospitalAnimation;
    }

    public static Animation getHighlightedFirefighterDepartmentAnimation() {
        if (highlightedFireFighterDepartmentAnimation == null) {
            highlightedFireFighterDepartmentAnimation = new Animation();
            highlightedFireFighterDepartmentAnimation.setLooping(true);
            highlightedFireFighterDepartmentAnimation.setAutoUpdate(true);

            for (int row = 0; row < getHighlightedFirefighterDepartmentSpriteSheet().getHorizontalCount(); row++) {
                for (int frame = 0; frame < getHighlightedFirefighterDepartmentSpriteSheet().getVerticalCount(); frame++) {
View Full Code Here

        }
        return genericEmergencyAnimation;
    }

    public static Animation getEmergencyAnimation(EmergencyType emergencyType, Integer numberOfPeople) {
        Animation emergencyAnimation = new Animation();
        emergencyAnimation.setLooping(true);
        emergencyAnimation.setAutoUpdate(true);

        for (int row = 0; row < getEmergencySpriteSheet(emergencyType).getHorizontalCount(); row++) {
            for (int frame = 0; frame < getEmergencySpriteSheet(emergencyType).getVerticalCount(); frame++) {
                try {
                    Image sprite = getEmergencySpriteSheet(emergencyType).getSprite(row, frame);
                    if (numberOfPeople != null) {
                        sprite.getGraphics().drawString("" + numberOfPeople, sprite.getWidth() / 2, sprite.getHeight() / 2);
                    }
                    emergencyAnimation.addFrame(sprite, 250);
                } catch (SlickException ex) {
                    Logger.getLogger(AnimationFactory.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
View Full Code Here

        return emergencyAnimation;
    }

    public static Animation getMenuBarAnimation() {
        Animation menuBarAnimation = new Animation();
     
        menuBarAnimation.addFrame(getMenuBarSpriteSheet().getSprite(0, 0), 1000);

        return menuBarAnimation;
    }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.Animation$Frame

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.