TAILIEUCHUNG - THE JR PROGRAMMING LANGUAGE phần 9

Hình thức chung của báo cáo đầu vào thảo luận tại mục bao gồm một điều khoản ném tùy chọn như là một phần của mỗi lệnh hoạt động. Một lệnh hoạt động hiện nay có hình thức chung và khung được trộn lẫn trong các đặc điểm kỹ thuật của các thông số chính thức. Ví dụ, sau đây là hợp pháp: | 294 Interfacing JR and GUIs Figure gives a screen snapshot of the It shows two windows on a single system display. As seen each window consists of a menu a button and a board area. Windows are assigned unique identifiers 0 1 2 . and are considered to be ordered left-to-right according to those identifiers. Each board area holds two kinds of toys balls and boxes. The menu and button are used to create new balls. Each menu click creates a single green or orange ball. Each button click creates a blue ball and a red ball. The balls and boxes move within the board area. Each board area is initially assigned a box. Only one box for each window exists during each game. The balls and boxes are labeled with the number of the window from which they originated. The board area also contains a text message which simply moves randomly within the board area. Balls move automatically left to right across the window zig-zagging between the top and bottom. They bounce off the top or bottom effecting a change in their upward or downward direction. Each ball s initial placement within its originating window is randomly chosen. When a ball reaches the right border it moves to the next window on the right according to the ordering on window identifiers or wraps around to the first window. Each ball expires after it has moved a certain number of times. Boxes move under user keyboard control. When a box reaches the left or right border it moves to the previous or next window respectively. Boxes cannot move beyond the top or bottom border. Each box lives for the duration of the game. As noted in the introduction to this chapter the game is fairly simple so as to illustrate the basic concepts in using Swing. Exercises and suggest how to make the game more interesting. BnB Code Overview The BnB program consists of the following classes Main the main program. It creates all the windows in the game. Window represents a window one for each player . It creates the .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.