tailieunhanh - Microsoft Excel VBA Programming for the Absolute Beginner Second Edition phần 10

Làm thế nào để chơi các trò chơi Excetris được mô tả ở phần đầu của chương này và các bảng tính có chứa các trò chơi được thể hiện một lần nữa trong hình 10,10. Mục tiêu của tôi cho chương trình này là để chứng minh việc sử dụng các đối tượng thu hình dạng và một số đối tượng thành phần của nó trong khi tạo ra một chương trình thú vị. | Chapter 10 VBA Shapes 439 Chapter Project Excetris How to play the Excetris game was described at the beginning of the chapter and the worksheet containing the game is shown again in Figure . My objective for this program is to demonstrate the use of the Shapes collection object and some of its component objects while creating a fun program. Figure The Excetris worksheet. Excetris involves a minimal amount of animation involving a small group of Shape objects as they move down the area of the worksheet defined as the game board cells C3 L17 in Figure . VBA is somewhat limited with regard to animation. The easiest tool available for use in animating an object is the OnTime method of the Application object however its minimum one-second interval see Chapter 4 will prevent Excetris from reaching a high level of difficulty for the player. Requirements for Excetris My idea is to create a game modeled after the original Tetris with an emphasis on programming Shape objects in Excel. The game s interface will once again be constructed from a worksheet. A specific range on a worksheet provides the game board and the game pieces are constructed out of Shape objects AutoShapes of type msoShapeRectangle . The program tallies a score based on the number of shapes removed from the game board and assigns bonus points when multiple rows are removed as a result of placing a single shape. Microsoft Excel VBA Programming for the Absolute Beginner Second Edition In the Real World Multitasking refers to a computer s ability to manage multiple processes with a single central processing unit CPU . For example it is common to have more than one application such as Microsoft Word and Excel open at the same time. For each application that is open and running the operating system creates a separate execution path called a thread. In many programming languages it is also possible to create a single application that involves multiple threads. Your program can carry out more .