Package transientlibs.maps.tiles

Examples of transientlibs.maps.tiles.Tile


        for (double x = x1; x <= x2; x += xStep) {
            for (double y = y1; y <= y2; y += yStep) {
                int ix = (int) x;
                int iy = (int) y;
                Tile targetTile = mo.onMap.getTile(ix, iy);
                result = result || (targetTile != null && targetTile.terrain.moveCost == -1);
            }
        }

        }
View Full Code Here


    public void performTeleport(float toX, float toY) {

        //Log.info("Pre-move coords are: "+mapCoords.toString());


     Tile oldTile = onMap.getTile(mapCoords.getIntX(), mapCoords.getIntY());
     Tile newTile = onMap.getTile(mapCoords.getIntX(), mapCoords.getIntY());


        mapCoords.x = toX;
        mapCoords.y = toY;
View Full Code Here

                {
                    Log.warn("Pull tile: "+x+"/"+y);

                    //GenericUnit u = map.getTile(startMapX + x, startMapY + y).units.get(0);
                    Tile t = map.getTile(startMapX + x, startMapY + y);

                    if (t != null) {
                        Log.warn("HAVE ONE");

                        //gridElements.get(y).get(x).setBothImages(u.getCreatures().visualInformation.cutImages.get(u.getDirection()).get(0).get(0).referencedImages);
View Full Code Here

    public Tile deltaTile(float deltaX, float deltaY) {

        float checkX = mapCoords.x + deltaX;
        float checkY = mapCoords.y + deltaY;

        Tile tile;
        try {
            tile = onMap.getTile((int) (checkX), (int) (checkY));
        } catch (ArrayIndexOutOfBoundsException ex) {
            Log.info("null");
            tile = null;
View Full Code Here


        int tryX = (int) (mapCoords.getIntX() + xDelta);
        int tryY = (int) (mapCoords.getIntY() + yDelta);

        Tile tryTile;

        if ((tryX > 0) && (tryX <= onMap.sizeX)
                && (tryY > 0) && (tryY <= onMap.sizeY)) {
            tryTile = onMap.getTile(tryX, tryY);
        } else {
            tryTile = null;
        }

        //Log.info("TryY "+tryY);
        //Log.info("Map sizeY "+onMap.sizeY);

        if (onMap.returnTileUnit(tryX, tryY, 0) == null) {
            collidedUnit = null;
        } else {
            collidedUnit = tryTile.units.get(0);
        }

        return ((tryTile != null)
                && (collidedUnit == null)
                && (tryTile.isMoveable()));

    }
View Full Code Here

    }

    public void addTile(int toX, int toY, int terrainID) {
//Note: crashes if toX is greater then map sizeX

        tile[toX][toY] = new Tile(terrainID, toX, toY, this);
        tile[toX][toY].calcImagePosition();
        //tileList.add(tile[toX][toY]);

        if (terrainID != -1) {
            tiles.get(toX).get(toY).changeTerrain(terrainID);
View Full Code Here

            currentRow = new ArrayList<Tile>();
            tiles.add(currentRow);

            for (int yc = 0; yc <= sizeY; yc++) {

                currentRow.add(new Tile(Terrain.terrains.get(0).ID, xc, yc - 1, this));
            }

        }
    }
View Full Code Here

        //Log.info("Pre-move coords are: "+mapCoords.toString());



        Tile oldTile = onMap.getTile(mapCoords.getIntX(), mapCoords.getIntY());

        mapCoords.x = toX;
        mapCoords.y = toY;

        //Log.info("Now on "+mapCoords.getIntX()+"/"+mapCoords.getIntY());

        Tile newTile = onMap.getTile(mapCoords.getIntX(), mapCoords.getIntY());

        if (oldTile != newTile) {
            oldTile.units.remove(this);
            newTile.units.add(this);
View Full Code Here

TOP

Related Classes of transientlibs.maps.tiles.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.