Package org.powerbot.game.api.wrappers

Examples of org.powerbot.game.api.wrappers.Tile


            entity = loc;
        }

        if (!Calculations.isOnScreen(entity.getCentralPoint())) {
            synchronized (mouseLock) {
                final Tile randTile = new Tile(loc.getX(), loc.getY(), loc.getPlane());
                randTile.derive(Random.nextInt(-1, 2), Random.nextInt(-1, 2));
                final LocalPath localPath = Walking.findPath(randTile.canReach() ? randTile : loc);
                localPath.getNext();
                final Tile[] tilePath = truncatePath(localPath.getTilePath().toArray(), 3);
                (new TilePath(tilePath)).traverse();
            }
View Full Code Here


    public static boolean isOrientedTowards(final Locatable locatable) {
        if (locatable == null) {
            return false;
        }

        final Tile t1 = Players.getLocal().getLocation(), t2 = locatable.getLocation();
        if (t1.equals(t2)) {
            return true;
        }

        final int xDiv = (t2.getX() - t1.getX()), yDiv = (t2.getY() - t1.getY());
        final double orient = Players.getLocal().getOrientation();
        final double angle = (Math.toDegrees(Math.atan2(yDiv, xDiv)) + 360) % 360;
        return Math.abs(angle - orient) < 5;   //small deviation when converting radians to and from degrees
    }
View Full Code Here

TOP

Related Classes of org.powerbot.game.api.wrappers.Tile

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.