Skip to content

Commit

Permalink
add screenshot modify css
Browse files Browse the repository at this point in the history
  • Loading branch information
leewyatt committed May 10, 2022
1 parent 8949cba commit 1250aca
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
> 目前的 加群问题: JavaFX是什么? 答: JAVA图形界面技术
There are a variety of game props.
![screenshot](ReadmeImages/construct.jpg)
![screenshot](ReadmeImages/game.jpg)
![screenshot](ReadmeImages/startup.jpg)
Binary file added ReadmeImages/construct.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ReadmeImages/startup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/main/java/com/leewyatt/github/tank/ui/ConstructPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -139,6 +136,7 @@ private TilePane initTilesButtonPane() {
btnBrick, btnBrick4, btnStone, btnStone4, btnSnow, btnSnow4, btnSea, btnSea4, btnGreens, btnGreens4, btnEmpty, btnEmpty4
);
tp.setVgap(8);
tp.setTileAlignment(Pos.TOP_CENTER);
return tp;
}

Expand Down Expand Up @@ -222,6 +220,7 @@ private void loadMapData() {
}

private void initMapData() {
//boolean exists= new File(GameConfig.CUSTOM_LEVEL_DATA).exists();
boolean exists = getFileSystemService().exists(GameConfig.CUSTOM_LEVEL_DATA);
if (exists) {
loadMapData();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/leewyatt/github/tank/ui/GameMainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public GameMainMenu() {
texture.setLayoutX(144);
texture.setLayoutY(160);

MainMenuButton newGameBtn = new MainMenuButton("START", this::fireNewGame);
MainMenuButton constructBtn = new MainMenuButton("CONSTRUCT",()->{
MainMenuButton newGameBtn = new MainMenuButton("START GAME", this::fireNewGame);
MainMenuButton constructBtn = new MainMenuButton("CONSTRUCT", () -> {
getContentRoot().getChildren().setAll(new ConstructPane());
});
MainMenuButton helpBtn = new MainMenuButton("HELP", this::instructions);
MainMenuButton exitBtn = new MainMenuButton("EXIT", ()->getGameController().exit());
MainMenuButton exitBtn = new MainMenuButton("EXIT", () -> getGameController().exit());
ToggleGroup tg = new ToggleGroup();
tg.getToggles().addAll(newGameBtn,constructBtn,helpBtn,exitBtn);
tg.getToggles().addAll(newGameBtn, constructBtn, helpBtn, exitBtn);
newGameBtn.setSelected(true);
VBox menuBox = new VBox(
5,
Expand All @@ -54,7 +54,7 @@ public GameMainMenu() {
);
menuBox.setAlignment(Pos.CENTER_LEFT);
menuBox.setLayoutX(240);
menuBox.setLayoutY(390);
menuBox.setLayoutY(360);
menuBox.setVisible(false);

Texture tankTexture = FXGL.texture("ui/tankLoading.png");
Expand All @@ -75,7 +75,7 @@ public GameMainMenu() {
textureWall.setLayoutX(310);
textureWall.setLayoutY(600);

defaultPane = new Pane(bgRect, texture, tankTexture, menuBox, line,textureWall);
defaultPane = new Pane(bgRect, texture, tankTexture, menuBox, line, textureWall);
getContentRoot().getChildren().setAll(defaultPane);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/properties/game.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ playerShootDelay=0.3
# \u73A9\u5BB6\u79FB\u52A8\u901F\u5EA6
playerSpeed=100
#----------------\u654C\u65B9-----------------
# \u654C\u65B9\u5766\u514B\u6570\u91CF >=3
enemyAmount=3
# 3<=\u654C\u65B9\u5766\u514B\u6570\u91CF<=20
enemyAmount=20
# \u654C\u65B9\u5B50\u5F39\u901F\u5EA6
enemyBulletSpeed=450
# \u654C\u65B9\u5C04\u51FB\u95F4\u9694\u65F6\u95F4(\u79D2)
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/assets/ui/css/tankApp.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
.construct-pane {
-fx-background-color: GRAY;
}

.tile-btn {
-fx-background-color: white;
-fx-effect: dropshadow(three-pass-box, gray, 2, 0.2, 0, 0);
}
.tile-btn:focused {
-fx-background-color: black;
}
Expand Down Expand Up @@ -72,6 +75,9 @@
-fx-background-color: black;
-fx-text-fill: white;
}
.bottom-box .button:focused {
-fx-effect: dropshadow(three-pass-box, black, 5, 0.2, 0, 0);
}

.bottom-box .button Region {
-fx-pref-width: 20px;
Expand Down

0 comments on commit 1250aca

Please sign in to comment.