Package de.zelosfan.timedstrategy.world

Examples of de.zelosfan.timedstrategy.world.Building


                if (world.tiles[i][l].entity == null) {
                    world.tiles[i][l].locked = false;
                }

                if (world.tiles[i][l] instanceof Building) {
                    Building building = (Building) world.tiles[i][l];
                    if (world.tiles[i][l].entity != null) {
                        if (((Building) world.tiles[i][l]).team == null) {
                            ((BuildingTyp) world.tiles[i][l].tiletyp).onCapture((Building) world.tiles[i][l], world.tiles[i][l].entity);
                        } else if (!world.tiles[i][l].entity.team.equals(((Building) world.tiles[i][l]).team)) {
                            ((BuildingTyp) world.tiles[i][l].tiletyp).onCapture((Building) world.tiles[i][l], world.tiles[i][l].entity);
View Full Code Here


                        break;
                }

                if (Main.game.world.tiles[x][y] instanceof Building) {
                    Building building = (Building) Main.game.world.tiles[x][y];
                    rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("stone"), Tile.SIZE * x, Tile.SIZE * y, Tile.SIZE, Tile.SIZE);

                    if (building.team != null) {
                        if (building.team.equals(Main.game.blueTeam) || !Main.game.world.FOG_OF_WAR || Main.game.visible.contains(Main.game.world.tiles[x][y])|| building.tiletyp.equals(Repository.tiletypObjectMap.get("hq"))) {
                            rendermanager.spriteBatch.setColor(building.team.color);
                        }
                    } else {
                        rendermanager.spriteBatch.setColor(Repository.grey);
                    }

                }
//                if (Main.game.world.tiles[x][y].locked) {
//                    rendermanager.spriteBatch.setColor(Color.PINK);
//                }
                    rendermanager.spriteBatch.draw(Main.game.world.tiles[x][y].tiletyp.textureRegion, Tile.SIZE * x, Tile.SIZE * y, Tile.SIZE, Tile.SIZE);
                rendermanager.spriteBatch.setColor(Color.WHITE);

                if (Main.game.world.tiles[x][y] instanceof Building) {
                    ((BuildingTyp) Main.game.world.tiles[x][y].tiletyp).render(rendermanager, (Building) Main.game.world.tiles[x][y]);
                }
            }
        }

        for (Entity entity: Main.game.world.entities) {
                if (entity != null) {
                    if (Main.game.visible.contains(entity.tile) || entity.team.equals(Main.game.blueTeam) || !Main.game.world.FOG_OF_WAR) {
                        if (entity.team.flip) {
                           entity.entitytyp.textureRegion.flip(true, false);
                        }


                        if (entity.waypoints != null) {
                            if (!entity.waypoints.isEmpty() && entity.team.equals(Game.blueTeam)) {
                               rendermanager.spriteBatch.setColor(Repository.used);
                               rendermanager.spriteBatch.draw(entity.entitytyp.textureRegion, Tile.SIZE * ((Tile) entity.waypoints.getLast()).posX, Tile.SIZE * ((Tile) entity.waypoints.getLast()).posY, Tile.SIZE, Tile.SIZE);
                            }
                        }
                        rendermanager.spriteBatch.setColor(entity.team.color);

                        if (Main.game.currentAction == CurrentAction.TO_SELECT_ENTITY) {
                            if (GametimeManager.TICKCOUNT % 60 < 30) {
                                rendermanager.spriteBatch.setColor(Color.YELLOW);
                            }
                        }


                        rendermanager.spriteBatch.draw(entity.entitytyp.textureRegion, Tile.SIZE * entity.tile.posX + entity.offsetX, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE, Tile.SIZE);
                        rendermanager.spriteBatch.setColor(Color.WHITE);

                        if (Main.game.currentAction == CurrentAction.TO_SELECT_ENTITY) {
                            if (entity.entitytyp.cost <= Main.game.blueTeam.money) {
                                rendermanager.spriteBatch.setColor(Color.GREEN);
                            } else {
                                rendermanager.spriteBatch.setColor(Color.RED);
                            }
                            rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("highlighter"), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.1f, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE * 0.8f, Tile.SIZE * 0.4f);
                            rendermanager.spriteBatch.setColor(Color.WHITE);
                            rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("10s"), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.4f, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE * 0.4f, Tile.SIZE * 0.4f);
                            drawIndependentText(rendermanager, Main.fontMap.get("tektonpro").get(24), "font", "" + entity.entitytyp.cost, Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.2f, Tile.SIZE * entity.tile.posY + entity.offsetY + Tile.SIZE * 0.5f, Color.WHITE);
                        } else if (entity.health / 10 < 10) {
                            rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("heart"), Tile.SIZE * entity.tile.posX + entity.offsetX, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE * 0.6f, Tile.SIZE * 0.6f);
                            drawIndependentText(rendermanager, Main.fontMap.get("tektonpro").get(24), "font", "" + Math.max(entity.health / 10, 1), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.15f, Tile.SIZE * entity.tile.posY + entity.offsetY + Tile.SIZE * 0.6f, Color.WHITE);
                        }

                        if (entity.waypoints != null && entity.team.equals(Game.blueTeam)) {
                            if (!entity.waypoints.isEmpty() && Main.game.currentAction != CurrentAction.ATTACK) {
                                rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("check"), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.6f, Tile.SIZE * entity.tile.posY + entity.offsetY + Tile.SIZE * 0.6f, Tile.SIZE * 0.45f, Tile.SIZE * 0.45f);
                            }
                        }

                        if (entity.team.flip) {
                           entity.entitytyp.textureRegion.flip(true, false);
                        }
                    }
                }
        }
        for (int x = 0; x < Main.game.world.WORLD_WIDTH; x++) {
            for (int y = Main.game.world.WORLD_HEIGHT - 1; y >= 0; y--) {
                if (Main.game.world.tiles[x][y] instanceof Building) {

                    Building building = (Building) Main.game.world.tiles[x][y];

                    Color color = Repository.grey;

                    if (building.team != null) {
                        if (building.team.equals(Main.game.blueTeam) || Main.game.visible.contains(building) || !Main.game.world.FOG_OF_WAR || building.tiletyp.equals(Repository.tiletypObjectMap.get("hq"))) {
View Full Code Here

                        }
                    }
                }

                if (tile instanceof Building && entity.target == null) {
                    Building building = (Building) tile;
                    if (building.team == null && !(building.tiletyp instanceof BuildingHeadquarter)) {
                        boolean allowed = false;
                        if (building.entity == null) {
                            allowed = true;
                        } else {
View Full Code Here

                                if (entity.waypoints.size() > 1) {
                                    if (!((Tile) entity.waypoints.get(1)).locked && (((Tile) entity.waypoints.get(1)).tiletyp.waycost <= entity.waycost || entity.team.equals(Game.blueTeam))) {
                                        finished = false;
                                        if (entity.tile instanceof Building) {
                                            Building building = (Building) entity.tile;

                                            if (building.team != null) {
                                                if (building.team.equals(entity.team)) {
                                                    entity.waypoints.poll();
View Full Code Here

TOP

Related Classes of de.zelosfan.timedstrategy.world.Building

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.