diff --git a/.gitignore b/.gitignore index 5531592..318d32e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ ## custom /desktop/save.json +/release-prepare/* +!/release-prepare/packr-config.json ## Java diff --git a/README.md b/README.md index 7427aa1..8b7e86c 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,33 @@ A clicker game. +Some bug can become an an industry. +Now You are a manager of a forest with bees. Gather some wood and wild bee as start. Build beehives which can generate bee, honey and beewax. Sell resources and products for coins. Finally, collect enough queen-bee for win-the-game! +### release +Download the zip. Use the win64 exe file, or the jar file. +### How to play +- Some constuctions are free. Click and gain its output. + +![](./pic/1.jpg) + +- Area-change-button is on the right border. Now we change to forest-area. + +![](./pic/2.jpg) + +- Some constuctions can swtich working-level by "+" / "-" button. Now we enable 1-level wood-selling and gain coins. + +![](./pic/3.jpg) + +- Upgrade other constuctions if your can afdord its upgrade-cost. And constuction only work if your can afdord its auto-work-cost. + +![](./pic/4.jpg) + +### Assert thanks Audio: https://opengameart.org/sites/default/files/Loop-Menu.wav @@ -14,3 +36,7 @@ https://opengameart.org/sites/default/files/forest_0.mp3 image: https://opengameart.org/content/backgrounds-3 +// TODO more + +text-generate: +https://cooltext.com/ diff --git a/core/assets/640x480.png b/core/assets/640x480.png deleted file mode 100644 index efe209b..0000000 Binary files a/core/assets/640x480.png and /dev/null differ diff --git a/core/assets/bee-area.png b/core/assets/bee-area.png new file mode 100644 index 0000000..6bf8b88 Binary files /dev/null and b/core/assets/bee-area.png differ diff --git a/core/assets/cookie.png b/core/assets/cookie.png deleted file mode 100644 index 5b40f95..0000000 Binary files a/core/assets/cookie.png and /dev/null differ diff --git a/core/assets/forest-area.png b/core/assets/forest-area.png new file mode 100644 index 0000000..e20b919 Binary files /dev/null and b/core/assets/forest-area.png differ diff --git a/core/assets/gameAreaIcons.png b/core/assets/gameAreaIcons.png index 613598e..a102cd1 100644 Binary files a/core/assets/gameAreaIcons.png and b/core/assets/gameAreaIcons.png differ diff --git a/core/assets/menu.png b/core/assets/menu.png new file mode 100644 index 0000000..651e4b5 Binary files /dev/null and b/core/assets/menu.png differ diff --git a/core/assets/win.png b/core/assets/win.png new file mode 100644 index 0000000..7d89ac4 Binary files /dev/null and b/core/assets/win.png differ diff --git a/core/src/hundun/gdxgame/bugindustry/BugIndustryGame.java b/core/src/hundun/gdxgame/bugindustry/BugIndustryGame.java index a0e48bb..7afd8e1 100644 --- a/core/src/hundun/gdxgame/bugindustry/BugIndustryGame.java +++ b/core/src/hundun/gdxgame/bugindustry/BugIndustryGame.java @@ -35,8 +35,8 @@ import lombok.Getter; public class BugIndustryGame extends Game { - public boolean debugMode = true; - public boolean drawGameImageAndPlayAudio = false; + public boolean debugMode = false; + public boolean drawGameImageAndPlayAudio = true; public static int scale = 1; public static final int LOGIC_WIDTH = 640; public static final int LOGIC_HEIGHT = 480; diff --git a/core/src/hundun/gdxgame/bugindustry/model/GameDictionary.java b/core/src/hundun/gdxgame/bugindustry/model/GameDictionary.java index 7568298..9fa45c4 100644 --- a/core/src/hundun/gdxgame/bugindustry/model/GameDictionary.java +++ b/core/src/hundun/gdxgame/bugindustry/model/GameDictionary.java @@ -11,20 +11,40 @@ public class GameDictionary { public String constructionIdToShowName(ConstructionId constructionId) { switch (constructionId) { - case WOOD_GATHER_HOUSE: - return "free wood"; - case WOOD_KEEPING: - return "feller"; - case BEE_GATHER_HOUSE: - return "free bee"; - case SMALL_BEEHIVE: - return "small beehive"; - case HONEY_SELL_HOUSE: - return "honey selling"; - case HONEY_BUFF_PROVIDER: - return "honey gene"; - default: - return "[dic:" + constructionId.name() + "]"; + + case WOOD_GATHER_HOUSE: + return "free wood"; + case WOOD_KEEPING: + return "plate tree"; + case WOOD_BOARD_MAKER: + return "board maker"; + case WIN_THE_GAME: + return "win goal"; + + case BEE_GATHER_HOUSE: + return "free bee"; + case SMALL_BEEHIVE: + return "small beehive"; + case MID_BEEHIVE: + return "mid beehive"; + case BIG_BEEHIVE: + return "big beehive"; + case QUEEN_BEEHIVE: + return "queen beehive"; + + case WOOD_SELL_HOUSE: + return "sell wood"; + case WOOD_BOARD_SELL_HOUSE: + return "sell board"; + case BEE_SELL_HOUSE: + return "sell bee"; + case HONEY_SELL_HOUSE: + return "sell honey"; + case BEEWAX_SELL_HOUSE: + return "sell beewax"; + + default: + return "[dic:" + constructionId.name() + "]"; } } } diff --git a/core/src/hundun/gdxgame/bugindustry/model/construction/BaseAutoConstruction.java b/core/src/hundun/gdxgame/bugindustry/model/construction/BaseAutoConstruction.java index f4a4619..acfd91c 100644 --- a/core/src/hundun/gdxgame/bugindustry/model/construction/BaseAutoConstruction.java +++ b/core/src/hundun/gdxgame/bugindustry/model/construction/BaseAutoConstruction.java @@ -52,7 +52,7 @@ protected void printDebugInfoAfterConstructed() { @Override public void onClick() { - if (!canUpgrade()) { + if (!canClickEffect()) { return; } Map upgradeCostRule = modifiedUpgradeCostMap; diff --git a/core/src/hundun/gdxgame/bugindustry/model/construction/BaseClickGatherConstruction.java b/core/src/hundun/gdxgame/bugindustry/model/construction/BaseClickGatherConstruction.java index c3ff80a..09702d4 100644 --- a/core/src/hundun/gdxgame/bugindustry/model/construction/BaseClickGatherConstruction.java +++ b/core/src/hundun/gdxgame/bugindustry/model/construction/BaseClickGatherConstruction.java @@ -19,7 +19,9 @@ public BaseClickGatherConstruction(BugIndustryGame game, ConstructionId id) { @Override public void onClick() { - + if (!canClickEffect()) { + return; + } game.getModelContext().getStorageManager().modifyAllResourceNum(modifiedOutputGainMap, true); } diff --git a/core/src/hundun/gdxgame/bugindustry/model/construction/ConstructionFactory.java b/core/src/hundun/gdxgame/bugindustry/model/construction/ConstructionFactory.java index 600f38a..4ad74ff 100644 --- a/core/src/hundun/gdxgame/bugindustry/model/construction/ConstructionFactory.java +++ b/core/src/hundun/gdxgame/bugindustry/model/construction/ConstructionFactory.java @@ -50,6 +50,7 @@ private void initWood() { ResourceType.COIN, 25, ResourceType.WOOD, 5 ); + construction.setMAX_DRAW_NUM(15); register(construction); } { diff --git a/core/src/hundun/gdxgame/bugindustry/model/manager/AchievementManager.java b/core/src/hundun/gdxgame/bugindustry/model/manager/AchievementManager.java index d681e78..19f77f4 100644 --- a/core/src/hundun/gdxgame/bugindustry/model/manager/AchievementManager.java +++ b/core/src/hundun/gdxgame/bugindustry/model/manager/AchievementManager.java @@ -34,7 +34,7 @@ public AchievementManager(BugIndustryGame game) { } private void initPrototypes() { - addPrototype(new AchievementPrototype("Game win", "Own 100 Honey", + addPrototype(new AchievementPrototype("Game win", "You win the game!", null, Map.of(ResourceType.WIN_TROPHY, 1) )); diff --git a/core/src/hundun/gdxgame/bugindustry/model/manager/TextureManager.java b/core/src/hundun/gdxgame/bugindustry/model/manager/TextureManager.java index 96b1317..a765b88 100644 --- a/core/src/hundun/gdxgame/bugindustry/model/manager/TextureManager.java +++ b/core/src/hundun/gdxgame/bugindustry/model/manager/TextureManager.java @@ -13,8 +13,13 @@ import lombok.Getter; public class TextureManager { - private Texture mainAreaBackgroundTexture; + private Texture beeAreaBackgroundTexture; private Texture shopAreaBackgroundTexture; + private Texture forestAreaBackgroundTexture; + @Getter + private Texture winTexture; + @Getter + private Texture menuTexture; private Map itemRegionMap = new HashMap<>(); private Map constructionRegionMap = new HashMap<>(); private Map gameAreaLeftPartRegionMap = new HashMap<>(); @@ -24,8 +29,11 @@ public class TextureManager { TextureRegion defaultIcon; public TextureManager() { - mainAreaBackgroundTexture = new Texture(Gdx.files.internal("640x480.png")); + beeAreaBackgroundTexture = new Texture(Gdx.files.internal("bee-area.png")); shopAreaBackgroundTexture = new Texture(Gdx.files.internal("shop-area.png")); + forestAreaBackgroundTexture = new Texture(Gdx.files.internal("forest-area.png")); + winTexture = new Texture(Gdx.files.internal("win.png")); + menuTexture = new Texture(Gdx.files.internal("menu.png")); this.beeTexture = new Texture(Gdx.files.internal("bee.png")); { @@ -78,8 +86,10 @@ public Texture getBackgroundTexture(GameArea gameArea) { switch (gameArea) { case SHOP: return shopAreaBackgroundTexture; + case FOREST_FARM: + return forestAreaBackgroundTexture; default: - return mainAreaBackgroundTexture; + return beeAreaBackgroundTexture; } } diff --git a/core/src/hundun/gdxgame/bugindustry/ui/component/AchievementMaskBoard.java b/core/src/hundun/gdxgame/bugindustry/ui/component/AchievementMaskBoard.java index 0595f4f..c81700e 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/component/AchievementMaskBoard.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/component/AchievementMaskBoard.java @@ -1,13 +1,16 @@ package hundun.gdxgame.bugindustry.ui.component; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.scenes.scene2d.InputEvent; +import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.ui.Button; import com.badlogic.gdx.scenes.scene2d.ui.Container; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; +import com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable; import hundun.gdxgame.bugindustry.model.AchievementPrototype; import hundun.gdxgame.bugindustry.ui.screen.GameScreen; @@ -23,13 +26,13 @@ public class AchievementMaskBoard extends Table { public AchievementMaskBoard(GameScreen parent) { this.parent = parent; - this.setBackground(parent.maskBackgroundDrawable); + this.setBackground(new SpriteDrawable(new Sprite(parent.game.getTextureManager().getWinTexture()))); this.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); label = new Label("", parent.game.getButtonSkin()); this.add(label).center().row(); - Button textButton = new TextButton("comfirm", parent.game.getButtonSkin()); + Button textButton = new TextButton("continue", parent.game.getButtonSkin()); textButton.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { @@ -39,6 +42,7 @@ public void clicked(InputEvent event, float x, float y) { this.add(textButton).center(); this.setVisible(false); + } public void setAchievementPrototype(AchievementPrototype prototype) { label.setText(prototype.getDescription()); diff --git a/core/src/hundun/gdxgame/bugindustry/ui/component/GameAreaControlBoard.java b/core/src/hundun/gdxgame/bugindustry/ui/component/GameAreaControlBoard.java index 149788b..be446b1 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/component/GameAreaControlBoard.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/component/GameAreaControlBoard.java @@ -36,7 +36,7 @@ public class GameAreaControlBoard extends Table implements IGameAreaChangeListen public static final int WIDTH = FULL_CELL_WIDTH; public static final int Y = ConstructionControlBoard.BOARD_DISTANCE_TO_FRAME + ConstructionControlBoard.BOARD_HEIGHT + 5; static final int HEIGHT = Gdx.graphics.getHeight() - (StorageInfoBoard.BOARD_DISTANCE_TO_FRAME_TOP + StorageInfoBoard.BOARD_HEIGHT) - Y; - public static final int X = Gdx.graphics.getWidth() - WIDTH - 5; + public static final int X = Gdx.graphics.getWidth() - WIDTH; public GameAreaControlBoard(GameScreen parent) { super(); diff --git a/core/src/hundun/gdxgame/bugindustry/ui/component/GameImageDrawHelper.java b/core/src/hundun/gdxgame/bugindustry/ui/component/GameImageDrawHelper.java index 4279011..1e3f1cc 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/component/GameImageDrawHelper.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/component/GameImageDrawHelper.java @@ -74,12 +74,10 @@ public void drawAll() { gameEntityFactory.checkRandomeMoveSpeedChange(entity); positionChange(entity); - parent.game.getBatch().draw(entity.getTexture(), entity.getX(), entity.getY(), entity.getDrawWidth(), entity.getDrawHeight()); + parent.game.getBatch().draw(entity.getTexture(), entity.getX(), entity.getY(), (entity.isTextureFlipX() ? -1 : 1) * entity.getDrawWidth(), entity.getDrawHeight()); }); } - - parent.game.getBatch().end(); } @@ -110,7 +108,7 @@ public void onResourceChange(boolean fromLoad) { private void checkBeeEntityList() { ResourceType type = ResourceType.BEE; long resourceNum = parent.game.getModelContext().getStorageManager().getResourceNum(type); - int drawNum = (int) Math.min(MAX_DRAW_BEE_NUM, resourceNum > 0 ? Math.ceil(Math.log(resourceNum)) : 0); + int drawNum = (int) Math.min(MAX_DRAW_BEE_NUM, resourceNum); Queue gameEntities = beeQueue; while (gameEntities.size() > drawNum) { @@ -128,7 +126,7 @@ private void checkBeeEntityList() { private void checkEntityList(ConstructionId type) { BaseConstruction construction = parent.game.getModelContext().getConstructionFactory().getConstruction(type); int resourceNum = construction.getSaveData().getWorkingLevel(); - int drawNum = (int) Math.min(construction.getMAX_DRAW_NUM(), resourceNum > 1 ? Math.ceil(Math.log(resourceNum)) : resourceNum); + int drawNum = (int) Math.min(construction.getMAX_DRAW_NUM(), resourceNum); gameEntitiesOfTypes.computeIfAbsent(type, k -> new ConcurrentLinkedQueue<>()); Queue gameEntities = gameEntitiesOfTypes.get(type); while (gameEntities.size() > drawNum) { diff --git a/core/src/hundun/gdxgame/bugindustry/ui/component/PopupInfoBoard.java b/core/src/hundun/gdxgame/bugindustry/ui/component/PopupInfoBoard.java index b35e989..d36c20a 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/component/PopupInfoBoard.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/component/PopupInfoBoard.java @@ -32,6 +32,7 @@ public PopupInfoBoard(GameScreen parent) { private Container wapperContainer(T content) { Container container = new Container(content); container.setBackground(parent.tableBackgroundDrawable); + container.fill(true); return container; } diff --git a/core/src/hundun/gdxgame/bugindustry/ui/component/StorageInfoBoard.java b/core/src/hundun/gdxgame/bugindustry/ui/component/StorageInfoBoard.java index 83970c2..691e4c8 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/component/StorageInfoBoard.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/component/StorageInfoBoard.java @@ -28,7 +28,7 @@ */ public class StorageInfoBoard extends Table { - public static int BOARD_DISTANCE_TO_FRAME_TOP = 50; + public static int BOARD_DISTANCE_TO_FRAME_TOP = 10; public static int BOARD_DISTANCE_TO_FRAME_SIDE = 10; public static int BOARD_HEIGHT = 60; private static int NODE_HEIGHT = 25; @@ -78,7 +78,9 @@ public StorageInfoBoard(GameScreen parent) { initData(); rebuildCells(); - this.debug(); + if (parent.game.debugMode) { + this.debugAll(); + } } diff --git a/core/src/hundun/gdxgame/bugindustry/ui/image/GameEntityFactory.java b/core/src/hundun/gdxgame/bugindustry/ui/image/GameEntityFactory.java index 0ad7aed..dcdf559 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/image/GameEntityFactory.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/image/GameEntityFactory.java @@ -28,7 +28,7 @@ public class GameEntityFactory { public int TREE_MIN_Y; public int TREE_MAX_Y; - public float FLY_UNION_SPEED = 3; + public float FLY_UNION_SPEED = 2; ResourceType type; @@ -45,51 +45,81 @@ public GameEntityFactory(BugIndustryGame game) { this.game = game; FLY_MAX_X = Gdx.graphics.getWidth() - GameAreaControlBoard.WIDTH; - FLY_MIN_X = 0; + FLY_MIN_X = BEE_WIDTH; FLY_MAX_Y = Gdx.graphics.getHeight() - (StorageInfoBoard.BOARD_HEIGHT + StorageInfoBoard.BOARD_DISTANCE_TO_FRAME_TOP); FLY_MIN_Y = FLY_MAX_Y - 200; - + TREE_MAX_X = Gdx.graphics.getWidth() - GameAreaControlBoard.WIDTH - scale * Construction_WIDTH; + TREE_MIN_X = 0; + TREE_MAX_Y = Gdx.graphics.getHeight() - (StorageInfoBoard.BOARD_HEIGHT + StorageInfoBoard.BOARD_DISTANCE_TO_FRAME_TOP) - scale * Construction_HEIGHT; + TREE_MIN_Y = TREE_MAX_Y - 100; //this.beehiveTexture = new Texture(Gdx.files.internal("beehive.png")); + Gdx.app.log(this.getClass().getSimpleName(), "TREE_MAX_Y = " + TREE_MAX_Y + ", TREE_MIN_Y = " + TREE_MIN_Y); } public GameEntity newConstructionEntity(ConstructionId id, int index) { switch (id) { case WOOD_SELL_HOUSE: + return newConstructionEntity( + ConstructionEntity_BASE_X + 0 * ConstructionEntity_BASE_X_PAD - ConstructionEntity_X_PAD * index, + ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + false, + id); case SMALL_BEEHIVE: return newConstructionEntity( ConstructionEntity_BASE_X + 0 * ConstructionEntity_BASE_X_PAD - ConstructionEntity_X_PAD * index, ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + true, id); - case BEE_SELL_HOUSE: + case WOOD_BOARD_SELL_HOUSE: + return newConstructionEntity( + ConstructionEntity_BASE_X + 1 * ConstructionEntity_BASE_X_PAD - ConstructionEntity_X_PAD * index, + ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + false, + id); case MID_BEEHIVE: return newConstructionEntity( ConstructionEntity_BASE_X + 1 * ConstructionEntity_BASE_X_PAD - ConstructionEntity_X_PAD * index, ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + true, + id); + case BEE_SELL_HOUSE: + return newConstructionEntity( + ConstructionEntity_BASE_X + 2 * ConstructionEntity_BASE_X_PAD - ConstructionEntity_X_PAD * index, + ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + false, id); - case HONEY_SELL_HOUSE: case BIG_BEEHIVE: return newConstructionEntity( ConstructionEntity_BASE_X + 2 * ConstructionEntity_BASE_X_PAD - ConstructionEntity_X_PAD * index, ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + true, id); - case WOOD_BOARD_SELL_HOUSE: + case HONEY_SELL_HOUSE: + return newConstructionEntity( + ConstructionEntity_BASE_X + 3 * ConstructionEntity_BASE_X_PAD, + ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + false, + id); case QUEEN_BEEHIVE: return newConstructionEntity( ConstructionEntity_BASE_X + 3 * ConstructionEntity_BASE_X_PAD, ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + true, id); case BEEWAX_SELL_HOUSE: return newConstructionEntity( ConstructionEntity_BASE_X + 4 * ConstructionEntity_BASE_X_PAD, ConstructionEntity_BASE_Y - ConstructionEntity_Y_PAD * index, + false, id); case WOOD_KEEPING: - int randX = (int) (FLY_MIN_X + Math.random() * (FLY_MAX_X - FLY_MIN_X)); - int randY = (int) (FLY_MIN_Y + Math.random() * (FLY_MAX_Y - FLY_MIN_Y)); + int randX = (int) (TREE_MIN_X + Math.random() * (TREE_MAX_X - TREE_MIN_X)); + int randY = (int) (TREE_MIN_Y + Math.random() * (TREE_MAX_Y - TREE_MIN_Y)); return newConstructionEntity( randX, randY, + true, id); default: return null; @@ -97,23 +127,33 @@ public GameEntity newConstructionEntity(ConstructionId id, int index) { } } + static final int scale = 2; + static final int BEE_WIDTH = 64; + static final int BEE_HEIGHT = 64; + static final int SELL_Construction_WIDTH = 48; + static final int SELL_Construction_HEIGHT = 32; + static final int Construction_WIDTH = 32; + static final int Construction_HEIGHT = 64; static final int ConstructionEntity_BASE_X = 80; - static final int ConstructionEntity_BASE_X_PAD = 80; - static final int ConstructionEntity_BASE_Y = 300; + static final int ConstructionEntity_BASE_X_PAD = 90; + static final int ConstructionEntity_BASE_Y = 250; static final int ConstructionEntity_X_PAD = 15; static final int ConstructionEntity_Y_PAD = 30; - private GameEntity newConstructionEntity(int x, int y, ConstructionId constructionId) { -// return newConstructionEntity(x, y, 64, 64, constructionId); -// } -// -// private GameEntity newConstructionEntity(int x, int y, int drawWidth, int drawHeight, ConstructionId constructionId) { -// + private GameEntity newConstructionEntity(int x, int y, boolean sizeType1, ConstructionId constructionId) { + return newConstructionEntity(x, y, + scale * (sizeType1 ? Construction_WIDTH : SELL_Construction_WIDTH), + scale * (sizeType1 ? SELL_Construction_HEIGHT : SELL_Construction_HEIGHT), + constructionId); + } + + private GameEntity newConstructionEntity(int x, int y, int drawWidth, int drawHeight, ConstructionId constructionId) { + GameEntity entity = new GameEntity(); entity.setTexture(new Sprite(game.getTextureManager().getConstructionTexture(constructionId))); entity.setX(x); entity.setY(y); - entity.setDrawWidth(entity.getTexture().getRegionWidth()); - entity.setDrawHeight(entity.getTexture().getRegionHeight()); + entity.setDrawWidth(drawWidth); + entity.setDrawHeight(drawHeight); entity.setRandomMove(false); return entity; } @@ -124,8 +164,8 @@ public GameEntity newBeeEntity() { entity.setTexture(new Sprite(game.getTextureManager().getBeeTexture())); entity.setX((FLY_MAX_X - FLY_MIN_X) / 2); entity.setY((FLY_MAX_Y - FLY_MIN_Y) / 2); - entity.setDrawWidth(64); - entity.setDrawHeight(64); + entity.setDrawWidth(BEE_WIDTH); + entity.setDrawHeight(BEE_HEIGHT); entity.setRandomMove(true); entity.setRandomMoveCount(0); checkRandomeMoveSpeedChange(entity); diff --git a/core/src/hundun/gdxgame/bugindustry/ui/screen/GameScreen.java b/core/src/hundun/gdxgame/bugindustry/ui/screen/GameScreen.java index 1fe1d04..3300024 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/screen/GameScreen.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/screen/GameScreen.java @@ -10,6 +10,7 @@ import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; +import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Button; import com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup; import com.badlogic.gdx.scenes.scene2d.ui.Image; @@ -22,6 +23,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.Layout; import com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; +import com.badlogic.gdx.utils.viewport.FitViewport; import hundun.gdxgame.bugindustry.BugIndustryGame; import hundun.gdxgame.bugindustry.model.AchievementPrototype; @@ -69,9 +71,11 @@ public class GameScreen extends BaseScreen { @Getter GameArea area; + Stage backStage; + public GameScreen(BugIndustryGame game) { super(game); - + backStage = new Stage(new FitViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight())); } public void setAreaAndNotifyChildren(GameArea current) { @@ -91,7 +95,7 @@ private void initChildren() { // stage.addActor(backgroundImage); this.backgroundImageBox = new BackgroundImageBox(this); - stage.addActor(backgroundImageBox); + backStage.addActor(backgroundImageBox); tableBackgroundPixmap = new Pixmap(1,1, Pixmap.Format.RGB565); tableBackgroundPixmap.setColor(0.8f, 0.8f, 0.8f, 1.0f); @@ -117,11 +121,7 @@ private void initChildren() { gameAreaControlBoard = new GameAreaControlBoard(this); stage.addActor(gameAreaControlBoard); - clockLabel = new Label("", game.getButtonSkin()); - clockLabel.setBounds(0, Gdx.graphics.getHeight() - 10 - 50, 200, 50); - stage.addActor(clockLabel); - //backTable.debugAll(); - //stage.addActor(backTable); + popUpInfoBoard = new PopupInfoBoard(this); stage.addActor(popUpInfoBoard); @@ -140,6 +140,15 @@ private void initChildren() { // gameImageDrawHelper.addBeeEntity(); // gameImageDrawHelper.addBeeEntity(); // gameImageDrawHelper.addBeeEntity(); + + clockLabel = new Label("", game.getButtonSkin()); + clockLabel.setBounds(0, Gdx.graphics.getHeight() - 10 - 50, 200, 50); + if (game.debugMode) { + stage.addActor(clockLabel); + } + + //backTable.debugAll(); + //stage.addActor(backTable); } @Override @@ -165,12 +174,12 @@ public void render(float delta) { } stage.act(); - stage.draw(); + backStage.draw(); if (game.drawGameImageAndPlayAudio) { gameImageDrawHelper.drawAll(); } - + stage.draw(); } diff --git a/core/src/hundun/gdxgame/bugindustry/ui/screen/MenuScreen.java b/core/src/hundun/gdxgame/bugindustry/ui/screen/MenuScreen.java index 0d7288b..c03fb2c 100644 --- a/core/src/hundun/gdxgame/bugindustry/ui/screen/MenuScreen.java +++ b/core/src/hundun/gdxgame/bugindustry/ui/screen/MenuScreen.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; import com.badlogic.gdx.scenes.scene2d.ui.Button; +import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.utils.Array; @@ -40,11 +41,14 @@ public MenuScreen(BugIndustryGame game) { private void initScene2d() { + Image backImage = new Image(game.getTextureManager().getMenuTexture()); + stage.addActor(backImage); + table = new Table(); - table.setBounds((Gdx.graphics.getWidth() - BUTTON_WIDTH)/2, 0, BUTTON_WIDTH, Gdx.graphics.getHeight()); + table.setBounds((Gdx.graphics.getWidth() - BUTTON_WIDTH)/2, 0, BUTTON_WIDTH, Gdx.graphics.getHeight() / 2); stage.addActor(table); - buttonContinueGame = new TextButton("ContinueGame", game.getButtonSkin()); + buttonContinueGame = new TextButton("Continue Game", game.getButtonSkin()); //buttonContinueGame.setSize(100, 100); //buttonContinueGame.setPosition(0, 0); buttonContinueGame.addListener(new InputListener(){ @@ -69,7 +73,7 @@ public boolean touchDown (InputEvent event, float x, float y, int pointer, int b - buttonNewGame = new TextButton("NewGame", game.getButtonSkin()); + buttonNewGame = new TextButton("New Game", game.getButtonSkin()); buttonNewGame.addListener(new InputListener(){ @Override public void touchUp (InputEvent event, float x, float y, int pointer, int button) { diff --git a/desktop/src/hundun/gdxgame/bugindustry/desktop/BugIndustryDesktopLauncher.java b/desktop/src/hundun/gdxgame/bugindustry/desktop/DesktopLauncher.java similarity index 93% rename from desktop/src/hundun/gdxgame/bugindustry/desktop/BugIndustryDesktopLauncher.java rename to desktop/src/hundun/gdxgame/bugindustry/desktop/DesktopLauncher.java index 4973192..0b64524 100644 --- a/desktop/src/hundun/gdxgame/bugindustry/desktop/BugIndustryDesktopLauncher.java +++ b/desktop/src/hundun/gdxgame/bugindustry/desktop/DesktopLauncher.java @@ -4,7 +4,7 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; import hundun.gdxgame.bugindustry.BugIndustryGame; -public class BugIndustryDesktopLauncher { +public class DesktopLauncher { public static void main (String[] arg) { diff --git a/docs/construction.psd b/docs/construction.psd index f42dcea..19bc601 100644 Binary files a/docs/construction.psd and b/docs/construction.psd differ diff --git a/docs/gameArea.psd b/docs/gameArea.psd new file mode 100644 index 0000000..d731594 Binary files /dev/null and b/docs/gameArea.psd differ diff --git a/docs/icon-128.png b/docs/icon-128.png new file mode 100644 index 0000000..242ea93 Binary files /dev/null and b/docs/icon-128.png differ diff --git a/docs/icon.psd b/docs/icon.psd new file mode 100644 index 0000000..a676374 Binary files /dev/null and b/docs/icon.psd differ diff --git a/docs/icon15.png b/docs/icon15.png new file mode 100644 index 0000000..cd2b8d8 Binary files /dev/null and b/docs/icon15.png differ diff --git a/docs/icon40.png b/docs/icon40.png new file mode 100644 index 0000000..f595991 Binary files /dev/null and b/docs/icon40.png differ diff --git a/docs/menu.psd b/docs/menu.psd new file mode 100644 index 0000000..cf57d9e Binary files /dev/null and b/docs/menu.psd differ diff --git a/docs/title.png b/docs/title.png new file mode 100644 index 0000000..394a188 Binary files /dev/null and b/docs/title.png differ diff --git a/docs/win.psd b/docs/win.psd new file mode 100644 index 0000000..6dbcd4e Binary files /dev/null and b/docs/win.psd differ diff --git a/pic/1.jpg b/pic/1.jpg new file mode 100644 index 0000000..29ac71d Binary files /dev/null and b/pic/1.jpg differ diff --git a/pic/2.jpg b/pic/2.jpg new file mode 100644 index 0000000..4364bb9 Binary files /dev/null and b/pic/2.jpg differ diff --git a/pic/3.jpg b/pic/3.jpg new file mode 100644 index 0000000..ed2cd16 Binary files /dev/null and b/pic/3.jpg differ diff --git a/pic/4.jpg b/pic/4.jpg new file mode 100644 index 0000000..7216bfb Binary files /dev/null and b/pic/4.jpg differ diff --git a/release-prepare/packr-config.json b/release-prepare/packr-config.json new file mode 100644 index 0000000..9df26b7 --- /dev/null +++ b/release-prepare/packr-config.json @@ -0,0 +1,14 @@ +{ + "platform": "windows64", + "jdk": "ibm-semeru-open-jre_x64_windows_11.0.13_8_openj9-0.29.0.zip", + "executable": "bugindustry-1.0", + "classpath": [ + "desktop-1.0.jar" + ], + "mainclass": "hundun.gdxgame.bugindustry.desktop.DesktopLauncher", + "vmargs": [ + "Xmx1G" + ], + "minimizejre": "soft", + "output": "out" +} \ No newline at end of file