If you like this post, please click the ads on the blog. Thank you very much.
The first step in creating a Java game is showing something on the screen. How many classes can we use in Java? There are so many API. For example, Frame in AWT and JFrame in Swing. However, we can create the game framework easily by Netbeans IDE.
遊戲的主要視窗為JForm、遊戲的畫面放在JPanel裡,程式碼的框架如下:
The main window class in a Java game application is usually a JForm. The game elements are on JPanel. And the code prototype are the following:
執行結果如下,只是顯示文字在畫面上。
The result is displaying some text on the screen.
沒有留言:
張貼留言