Examples of Animation


Examples of org.newdawn.slick.Animation

        return emergencyAnimation;
    }

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

        return menuBarAnimation;
    }
View Full Code Here

Examples of org.newdawn.slick.Animation

        return menuBarAnimation;
    }

    public static Animation getEmergencyStatusAnimation( EmergencyType type, int total, int remaining) {
        Animation emergencyStatusAnimation = new Animation();
        emergencyStatusAnimation.setLooping(true);
        emergencyStatusAnimation.setAutoUpdate(true);
        if (type == EmergencyType.FIRE) {
            String percentage = calculatePercentage(total, remaining);
            emergencyStatusAnimation.addFrame(getFireEmergencyStatusSpriteSheet(percentage).getSprite(0, 0), 1000);
        }
        if (type == EmergencyType.HEART_ATTACK) {
            String percentage = calculatePercentage(total, remaining);
            emergencyStatusAnimation.addFrame(getHeartAttackEmergencyStatusSpriteSheet(percentage).getSprite(0, 0), 1000);
        }
        return emergencyStatusAnimation;
    }
View Full Code Here

Examples of org.newdawn.slick.Animation

        return glowSprites;
    }

    public static Animation getFireTruckAnimation() {
        if (fireTruckAnimation == null) {
            fireTruckAnimation = new Animation();
            fireTruckAnimation.setLooping(false);
            fireTruckAnimation.setAutoUpdate(false);

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

Examples of org.newdawn.slick.Animation

        return fireTruckAnimation;
    }
   
    public static Animation getFireTruckGrayedAnimation() {
        if (fireTruckGrayedAnimation == null) {
            fireTruckGrayedAnimation = new Animation();
            fireTruckGrayedAnimation.setLooping(false);
            fireTruckGrayedAnimation.setAutoUpdate(false);

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

Examples of org.newdawn.slick.Animation

        return fireTruckGrayedAnimation;
    }

    static Animation getPoliceCarAnimation() {
        if (policeCarAnimation == null) {
            policeCarAnimation = new Animation();
            policeCarAnimation.setLooping(false);
            policeCarAnimation.setAutoUpdate(false);

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

Examples of org.newdawn.slick.Animation

        }
        return policeCarAnimation;
    }

    public static Animation addGlow(Graphicable graphicable) {
        Animation glowAnimation = new Animation();
        glowAnimation.setLooping(false);
        glowAnimation.setAutoUpdate(true);

        for (int row = 0; row < getGlowSpriteSheet().getHorizontalCount(); row++) {
            for (int frame = 0; frame < getGlowSpriteSheet().getVerticalCount(); frame++) {
                try {
                    Image sprite = getGlowSpriteSheet().getSprite(row, frame);
                    sprite.getGraphics().drawImage(graphicable.getAnimation().getCurrentFrame(), 0, 0);
                    glowAnimation.addFrame(sprite, 250);
                } catch (SlickException ex) {
                    Logger.getLogger(AnimationFactory.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
View Full Code Here

Examples of org.newdawn.slick.Animation

    }

    public static GraphicableAmbulance newAmbulance(Ambulance ambulance) {
        GraphicableAmbulance graphAmbulance = new GraphicableAmbulance(ambulance);

        Animation myAmbulance = AnimationFactory.getAmbulanceAnimation().copy();
        EmergencyEntityBuilding central = CityEntities.buildings.get("911");
        Polygon myPolygon = new Polygon(new float[]{
                    (central.getX() * 16), central.getY() * 16,
                    (central.getX() * 16) + 28, (central.getY() * 16),
                    (central.getX() * 16) + 28, (central.getY() * 16) + 28,
View Full Code Here

Examples of org.newdawn.slick.Animation

    }

    public static GraphicableFireTruck newFireTruck(FireTruck fireTruck) {
        GraphicableFireTruck graphFireTruck = new GraphicableFireTruck(fireTruck);

        Animation myFireTruck = AnimationFactory.getFireTruckAnimation().copy();
        EmergencyEntityBuilding firefighters = CityEntities.buildings.get("Firefighters Department");
        Polygon myPolygon = new Polygon(new float[]{
                    firefighters.getX() * 16, firefighters.getY() * 16,
                    (firefighters.getX() * 16) + 28, (firefighters.getY() * 16),
                    (firefighters.getX() * 16) + 28, (firefighters.getY() * 16) + 28,
View Full Code Here

Examples of org.newdawn.slick.Animation

    }

    public static GraphicablePoliceCar newPoliceCar(PoliceCar policeCar) {
        GraphicablePoliceCar graphPoliceCar = new GraphicablePoliceCar(policeCar);

        Animation myPoliceCar = AnimationFactory.getPoliceCarAnimation().copy();
        EmergencyEntityBuilding policeDepartment = CityEntities.buildings.get("Police Department");
        Polygon myPolygon = new Polygon(new float[]{
                    policeDepartment.getX() * 16, policeDepartment.getY() * 16,
                    (policeDepartment.getX() * 16) + 28, (policeDepartment.getY() * 16),
                    (policeDepartment.getX() * 16) + 28, (policeDepartment.getY() * 16) + 28,
View Full Code Here

Examples of org.newdawn.slick.Animation

    }

    public static GraphicableHighlightedHospital newHighlightedHospital(Hospital hospital) {
        GraphicableHighlightedHospital graphHospital = new GraphicableHighlightedHospital(hospital);

        Animation myHospital = AnimationFactory.getHighlightedHospitalAnimation();

        Polygon myHospitalPolygon = new Polygon(new float[]{
                    Math.round(hospital.getX()) * 16, Math.round(hospital.getY()) * 16,
                    (Math.round(hospital.getX()) * 16) + 16, Math.round(hospital.getY()) * 16,
                    (Math.round(hospital.getX()) * 16) + 16, Math.round(hospital.getY()) * 16 + 16,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.