Package engine.geometry

Examples of engine.geometry.Rectangle


    }

    @Override
    protected void onAdd() {
        AnimationHabit animation = addHabit(new AnimationHabit());
        dynamic = addHabit(new DynamicHabit(new Rectangle(startPosition, new Vector(24, 48)).toPolygon(), 60));
        addHabit(new GravityHabit(dynamic));
        state = addHabit(new PlatformCharacterStateHabit(dynamic));
        addHabit(new PlatformCharacterInputHabit(state));
        addHabit(new PlatformCharacterAnimationHabit("player", 52, animation, state));
        addHabit(new PlatformCharacterMovementHabit(state, dynamic, animation));
View Full Code Here


    @Override
    protected void onDraw(RenderTarget target) {
        // HUD
        target.transformPush();
        target.transformIdentity();
        target.fillRectangle(new Rectangle(240, 24, 160, 16), new Colour(128, 128, 128, 128));
        target.fillRectangle(new Rectangle(240, 24, (160 * dust) / DUST_MAX, 16), new Colour(0, 128, 0, 128));
        target.transformPop();
    }
View Full Code Here

    @Override
    protected void onAdd() {
        AnimationHabit animation = addHabit(new AnimationHabit());
        DynamicHabit dynamic =
                addHabit(new DynamicHabit(new Rectangle(startPosition, new Vector(24, 48)).toPolygon(), 60));
        addHabit(new GravityHabit(dynamic));
        state = addHabit(new PlatformCharacterStateHabit(dynamic));
        addHabit(new PatrolHabit(state));
        addHabit(new PlatformCharacterAnimationHabit("soldier", 52, animation, state));
        addHabit(new PlatformCharacterMovementHabit(state, dynamic, animation));
View Full Code Here

    public final void onMove() {
        Physics.move(((LevelScene) getScene()).getBlocks(), polygon, velocity);
    }

    public final boolean onGround() {
        Rectangle check = new Rectangle(polygon.getMinX(), polygon.getMaxY(), polygon.getMaxX() - polygon.getMinX(), 1);
        return Physics.intersects(((LevelScene) getScene()).getBlocks(), check.toPolygon());
    }
View Full Code Here

            if (a.getName().equals("player")) {
                d.addActor(new PlayerActor(new Vector(Double.valueOf(a.getArgs()[0]), Double.valueOf(a.getArgs()[1]))));
            } else if (a.getName().equals("soldier")) {
                d.addActor(new SoldierActor(new Vector(Double.valueOf(a.getArgs()[0]), Double.valueOf(a.getArgs()[1]))));
            } else if (a.getName().equals("sign")) {
                d.addActor(new SignActor(a.getArgs()[4], new Rectangle(Double.valueOf(a.getArgs()[0]), Double.valueOf(a
                        .getArgs()[1]), Double.valueOf(a.getArgs()[2]), Double.valueOf(a.getArgs()[3]))));
            } else if (a.getName().equals("metal")) {
                d.addActor(new MetalActor(new Rectangle(Double.valueOf(a.getArgs()[0]), Double.valueOf(a.getArgs()[1]),
                        Double.valueOf(a.getArgs()[2]), Double.valueOf(a.getArgs()[3]))));
            } else {
                System.out.println("Unknown Actor in level file: " + a.getName());
            }
        }
View Full Code Here

            line.setX1(line.getX1() + x);
            line.setY1(line.getY1() + y);
            line.setX2(line.getX2() + x);
            line.setY2(line.getY2() + y);
        } else if (shape instanceof Rectangle) {
            Rectangle rectangle = (Rectangle) shape;
            rectangle.setX(rectangle.getX() + x);
            rectangle.setY(rectangle.getY() + y);
        } else if (shape instanceof Circle) {
            Circle circle = (Circle) shape;
            circle.setX(circle.getX() + x);
            circle.setY(circle.getY() + y);
        } else if (shape instanceof Polygon) {
View Full Code Here

    @Override
    public void onAdd() {
        text = "";
        position = new Vector(2, 476);
        rectangle = new Rectangle(0, 464, 640, 16);
        textColour = new Colour(255, 255, 255);
        rectColour = new Colour(0, 0, 0, 128);
        font = getStage().getLibrary().findFont("Debug");

        activeScenes = new LinkedList<Scene>();
View Full Code Here

            line.setX1(line.getX1() * x);
            line.setY1(line.getY1() * y);
            line.setX2(line.getX2() * x);
            line.setY2(line.getY2() * y);
        } else if (shape instanceof Rectangle) {
            Rectangle rectangle = (Rectangle) shape;
            rectangle.setX(rectangle.getX() * x);
            rectangle.setY(rectangle.getY() * y);
            rectangle.setWidth(rectangle.getWidth() * x);
            rectangle.setHeight(rectangle.getHeight() * y);
        } else if (shape instanceof Polygon) {
            Polygon polygon = (Polygon) shape;
            final int size = polygon.getSize();
            for (int i = 0; i < size; i++) {
                polygon.setVertex(i, polygon.getX(i) * x, polygon.getY(i) * y);
 
View Full Code Here

    @Override
    public void onAdd() {
        textColour = new Colour(255, 255, 255);
        position = new Vector(2, 12);
        font = getStage().getLibrary().findFont("Debug");
        rectangle = new Rectangle(0, 0, 640, 16);
        rectColour = new Colour(0, 0, 0, 128);
    }
View Full Code Here

        mousePos = new Vector();
        direction = new Vector();
       
        startPoint = new Point();
        endCircle = new Circle();
        bounds = new Rectangle();
    }
View Full Code Here

TOP

Related Classes of engine.geometry.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.