TAILIEUCHUNG - Microsoft visual C_4

C + + là một đối tượng theo định hướng lớn ngôn ngữ hỗ trợ nhiều tính năng hiện đại. Như tên của nó, nó là một phát triển hơn nữa của ngôn ngữ C. Trong chương này, bạn sẽ học những điều cơ bản của ngôn ngữ. Chương giao dịch tiếp theo với các phần hướng đối tượng của C + +. | The Tetris Application The document class manages the data of the game and handles the active falling down figure and the next shown to the right of the game grid figure. The view class accepts input from the keyboard and draws the figures and the game grid. The Figure class manages a single figure. It is responsible for movements and rotations. There are seven kinds of figures. The Figure Info files store information pertaining to their colors and shapes. The Tetris Files We start by creating a MFC application with the name Tetris and follow the steps of the Ring application. The classes CTetrisApp CMainFrame CTetrisDoc CTetrisView and CAboutDlg are then created and added to the project. There are only two differences. We need to state that we are dealing with a Single Document Application Type that the file extension is Trs and that the file type long name is A Game of Tetris . Otherwise we just accept the default settings. Note that in this application we accept the CView base class instead of the CScrollView like we did in the Ring application. 144 Chapter 6 145 The Tetris Application We add the marked lines below. In all other respects we leave the file unmodified. We will not need to modify the files and . include include include include include include include include The Square Class Square is a small class holding a row and column position. It is used by the figureInfo class in this application. class Square public Square Square int iRow int iCol int Row const return m_iRow int Col const return m_iCol private int m_iRow m_iCol The Color Grid Class The ColorGrid handles the background game grid of twenty rows and twenty columns. Each square can have a color. At the beginning every square is initialized to the default color white. The Index method is overloaded with a constant version that returns

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.