简易版扫雷代码Java扫雷入门

上传者: linbihui_zac | 上传时间: 2019-12-21 20:08:49 | 文件大小: 12KB | 文件类型: java
简易版扫雷程序代码 public class MineSweeperGame2 extends Application { Cell[][] cell; int totalMines=0; int markBomb=0; //总的地雷数量,简单会有10个,一般会有40个,困难99个 int showMines=10; String s=String.valueOf(showMines); Label tips=new Label("Game is running!"); Label showMineNum=new Label("mines: "+s); public void start(Stage primaryStage){ Stage startStage=new Stage(); //选择按钮的界面 Button startButton=new Button("RESTART"); Button chooseeasy=new Button(" EASY (10mines)"); Button choosenormal=new Button("NORMAL(40mines)"); Button choosehard=new Button(" HARD(99mines)"); BorderPane primaryPane=new BorderPane(); HBox startPane=new HBox(15); StackPane topButtonPane=new StackPane(startButton); StackPane topButtonPane2=new StackPane(showMineNum); StackPane buttomPane=new StackPane(tips); HBox topPane=new HBox(50); topPane.getChildren().addAll(topButtonPane,topButtonPane2); primaryPane.setTop(topPane); tips.setStyle("-fx-border-color:red;-fx-background-color:white;"); showMineNum.setStyle("-fx-border-color:black"); primaryPane.setBottom(buttomPane); buttomPane.setPadding(new Insets(15,15,15,15)); topPane.setPadding(new Insets(15,15,15,15)); startPane.setPadding(new Insets(15,15,15,15)); startPane.getChildren().add(chooseeasy); startPane.getChildren().add(choosenormal);

文件下载

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明