Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Polygon


    Point2d vecMinViewFieldPoint = VecMathUtils.getScaledVectorPoint(vecMinViewField, lightSensorPoint, 300);
    Point2d vecMaxViewFieldPoint = VecMathUtils.getScaledVectorPoint(vecMaxViewField, lightSensorPoint, 300);
    // drawLine(lightSensorPoint, vecMinViewFieldPoint, g);
    // drawLine(lightSensorPoint, vecMaxViewFieldPoint, g);

    Polygon pol = new Polygon();
    pol.addPoint((float) lightSensorPoint.getX(), (float) lightSensorPoint.getY());
    pol.addPoint((float) vecMaxViewFieldPoint.getX(), (float) vecMaxViewFieldPoint.getY());
    pol.addPoint((float) vecMinViewFieldPoint.getX(), (float) vecMinViewFieldPoint.getY());

    // GradientFill fill = new GradientFill((float) lightSensorPoint.getX(),
    // (float) lightSensorPoint.getY(), Color.lightGray,
    // (float) viewDirectionPoint.getX(), (float) viewDirectionPoint.getY(),
    // Color.black);
View Full Code Here


    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,
                    (central.getX() * 16), (central.getY() * 16) + 28
                });
View Full Code Here

    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,
                    (firefighters.getX() * 16), (firefighters.getY() * 16) + 28
                });
View Full Code Here

    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,
                    (policeDepartment.getX() * 16), (policeDepartment.getY() * 16) + 28
                });
View Full Code Here

    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,
                    Math.round(hospital.getX()) * 16, Math.round(hospital.getY()) * 16 + 16
                });
View Full Code Here

    public static GraphicableHighlightedFirefighterDepartment newHighlightedFirefighterDepartment(FirefightersDepartment firefightersDepartment) {
        GraphicableHighlightedFirefighterDepartment graphFirefightersDepartment = new GraphicableHighlightedFirefighterDepartment(firefightersDepartment);

        Animation myFireFighterDepartment = AnimationFactory.getHighlightedFirefighterDepartmentAnimation();

        Polygon myHospitalPolygon = new Polygon(new float[]{
                    Math.round(firefightersDepartment.getX()) * 16, Math.round(firefightersDepartment.getY()) * 16,
                    (Math.round(firefightersDepartment.getX()) * 16) + 16, Math.round(firefightersDepartment.getY()) * 16,
                    (Math.round(firefightersDepartment.getX()) * 16) + 16, Math.round(firefightersDepartment.getY()) * 16 + 16,
                    Math.round(firefightersDepartment.getX()) * 16, Math.round(firefightersDepartment.getY()) * 16 + 16
                });
View Full Code Here

            myEmergency = AnimationFactory.getGenericEmergencyAnimation();
        } else {
            myEmergency = AnimationFactory.getEmergencyAnimation(type, numberOfPeople);
        }

        Polygon myEmergencyPolygon = new Polygon(new float[]{
                    xs[call.getX()] * 16, ys[call.getY()] * 16,
                    (xs[call.getX()] * 16) + 32, ys[call.getY()] * 16,
                    (xs[call.getX()] * 16) + 32, (ys[call.getY()] * 16) + 32,
                    xs[call.getX()] * 16, (ys[call.getY()] * 16) + 32
                });
View Full Code Here

       
        GraphicableMenuBar graphMenuBar = new GraphicableMenuBar();
        Animation myMenuBar = AnimationFactory.getMenuBarAnimation();
       

        Polygon myMenuBarPolygon = new Polygon(new float[]{
                    0, 432,
                    640, 432,
                    640, 480,
                    0, 480
                });
View Full Code Here

        GraphicableEmergencyStatus emergencyStatus = new GraphicableEmergencyStatus();
     
       
        Animation myEmergencyStatus = AnimationFactory.getEmergencyStatusAnimation(type, total, total);
       
        Polygon myEmergencyStatusPolygon = new Polygon(new float[]{
                    0 + 30 , 432 + 10,
                    0 + 30 + 143, 432 + 10,
                    0 + 30 + 143, 432 + 10 + 28,
                    0 + 30 , 432 + 10 + 28
                });
View Full Code Here

        if (this.selectedHospital == null) {
            return false;
        }
       
       
        Polygon collidesWith = null;
        if (this.activeGraphicableVehicle.getPolygon().intersects(selectedHospital.getPolygon())) {
            collidesWith = selectedHospital.getPolygon();
        }
        boolean collides = collidesWith != null;
        if (collides && !this.activeGraphicableVehicle.isIsCollidingWithABuilding()) {
View Full Code Here

TOP

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

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.