Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
537 views
in Technique[技术] by (71.8m points)

java - 试图找出JavaFX Tetris游戏的GUI(Trying to figure out the GUI for a JavaFX Tetris Game)

I'm to do the design for the Tetris game for a project for a class.

(我要为一个班级的项目做俄罗斯方块游戏的设计。)

Using SceneBuilder to create the layout.

(使用SceneBuilder创建布局。)

From my understanding and the code my partner provided me with is

(从我的理解和我的伴侣提供给我的代码是)

create a bunch of graphical blocks that I can set to visible whenever spaces shows a spot as true and set to invisible whenever a spot shows as false

(创建一堆图形块,每当空格显示一个点为true时,我就可以将它们设置为可见;当一个点显示为false时,我可以将其设置为不可见。)

The way that I have gone about it is I created a Grid Panel inside a Pane, a 10x20 one more specifically.

(我采用的方法是在窗格内创建一个网格面板,更具体地说是10x20。)

Should that work?

(应该行吗?)

would say a T Block be able to to work under those conditions?

(会说T座能够在这些条件下工作吗?)

For reference on how he going about the "Spaces" to where the Blocks are to be placed is this

(供参考,以了解他如何将“空间”放置到放置块的位置)

//Length and width will always be 20 and 10 respectively
private int length = 20;
private int width = 10;

//Spaces represents each individual block of the board, which is either full or empty
private boolean[][]spaces = new boolean[length][width];

public Board()
{
    //Set each space to false, as at the beginning the board is empty.
    for(int x= 0; x < length; x++)
        for(int y = 0; y < length; y++)
            spaces[x][y] = false;
}
  ask by Role Chapa translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...