Examples of DirectionIntercardinal


Examples of squidpony.squidgrid.util.DirectionIntercardinal

     * other monsters, or the player.
     *
     * @param monster
     */
    private void moveMonster(Monster monster) {
        DirectionIntercardinal dir = DirectionIntercardinal.CARDINALS[rng.nextInt(DirectionIntercardinal.CARDINALS.length)];//get a random direction
        Tile tile = map[monster.x + dir.deltaX][monster.y + dir.deltaY];
        if (!tile.isWall() && tile.getMonster() == null) {
            map[monster.x][monster.y].setMonster(null);
            if (tile.isSeen()) {//only show animation if within sight
                mapPanel.slide(new Point(monster.x, monster.y), dir);
View Full Code Here

Examples of squidpony.squidgrid.util.DirectionIntercardinal

            float radius = rStrat.radius(x, y, x + dir.deltaX, y + dir.deltaY);
            float brightness = light - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + dir.deltaX, y + dir.deltaY, brightness, dir, dir, PRIMARY);

            DirectionIntercardinal pushing = dir.clockwise();
            radius = rStrat.radius(x, y, x + pushing.deltaX, y + pushing.deltaY);
            brightness = light - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + pushing.deltaX, y + pushing.deltaY, brightness, dir, pushing, SECONDARY);

            pushing = dir.counterClockwise();
            radius = rStrat.radius(x, y, x + pushing.deltaX, y + pushing.deltaY);
            brightness = light - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + pushing.deltaX, y + pushing.deltaY, brightness, dir, pushing, SECONDARY);
        } else {//type == SECONDARY at this point
            //push pass-through secondary ray
            DirectionIntercardinal pushing = previous;//redirect to previous' previous direction
            float radius = rStrat.radius(x, y, x + pushing.deltaX, y + pushing.deltaY);
            float brightness = light - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + pushing.deltaX, y + pushing.deltaY, brightness, dir, pushing, SECONDARY);

View Full Code Here

Examples of squidpony.squidgrid.util.DirectionIntercardinal

            float radius = rStrat.radius(x, y, x + dir.deltaX, y + dir.deltaY);
            float brightness = light - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + dir.deltaX, y + dir.deltaY, brightness, dir, dir, PRIMARY);

            DirectionIntercardinal pushing = dir.clockwise();
            radius = rStrat.radius(x, y, x + pushing.deltaX, y + pushing.deltaY);
            brightness = light  - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + pushing.deltaX, y + pushing.deltaY, brightness, dir, pushing, SECONDARY);

            pushing = dir.counterClockwise();
            radius = rStrat.radius(x, y, x + pushing.deltaX, y + pushing.deltaY);
            brightness = light  - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + pushing.deltaX, y + pushing.deltaY, brightness, dir, pushing, SECONDARY);
        } else {//type == SECONDARY at this point
            //push pass-through secondary ray
            DirectionIntercardinal pushing = previous;//redirect to previous' previous direction
            float radius = rStrat.radius(x, y, x + pushing.deltaX, y + pushing.deltaY);
            float brightness = light  - resistanceMap[x][y];//light is reduced by the portion of the square passed through
            brightness -= radius * decay;//reduce by the amount of decay from passing through
            pushLight(x + pushing.deltaX, y + pushing.deltaY, brightness, dir, pushing, SECONDARY);

View Full Code Here

Examples of squidpony.squidgrid.util.DirectionIntercardinal

     * Moves the monster given if possible. Monsters will not move into walls, other monsters, or the player.
     *
     * @param monster
     */
    private void moveMonster(Monster monster) {
        DirectionIntercardinal dir = DirectionIntercardinal.CARDINALS[rng.nextInt(DirectionIntercardinal.CARDINALS.length)];//get a random direction
        Tile tile = map[monster.x + dir.deltaX][monster.y + dir.deltaY];
        if (!tile.isWall() && tile.getMonster() == null) {
            map[monster.x][monster.y].setMonster(null);
            if (tile.isSeen()) {//only show animation if within sight
                mapPanel.slide(new Point(monster.x, monster.y), dir);
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.