TAILIEUCHUNG - microsoft visual basic game programming with directx phần 3

Tác giả của văn bản này cho thấy cách dễ dàng nó có thể được sản xuất trò chơi thú vị đa phương tiện bằng cách sử dụng quản lý DirectX 9,0 và lập trình với Visual Basic. NET Everett, các TheGameField mới nhất phiên bản ofshown mã trước các thành viên của nó (các thuộc tính và phương pháp) được định nghĩa giao diện Microsoft của Visual Studio. | NEW In Visual Basic .NET we don t have a parameter of the form Show method anymore to say if it IN should be shown modally the form is shown and execution continues after the form is closed or .NET modeless the form is shown and the code continues executing instead we have a showDialog method that should be used when we wish to show a form modally. In the preceding sample code the line is only executed after the form is closed by the user. Coding for the Introduction Screen Now is a good time to create an intro screen for our game. Our suggestion is shown in the Figure 2-17 but feel free to use your artistic talent to improve it. Figure 2-17 The .Netterpillars splash screen TheMain procedure must be changed to reflect the workflow diagram created in the project phase Sub main Dim WinSplash As frmSplash Dim WinGameField As frmGameField Create the game engine object objGameEngine New clsGameEngine WinSplash New frmSplash Do While WinGameField New frmGameField Shows the window immediately obj Do While Not obj Loop MsgBox Game Over .Netterpillars Loop objGameEngine Nothing End Sub That s it. We can now play with different field sizes number of mushrooms and netterpillars. But after playing a couple of times we ll soon discover that when we run our game a second time without making any configuratio changes our properties don t get reset so among other things we ll start with the last quantity of mushrooms that is without the ones that were eaten . And worst of all If the game field screen is being created for each game our handle passed to the objGameEngine New method becomes invalid. Since we can t simply move the obj GameEngine creation to inside the loop .

TỪ KHÓA LIÊN QUAN
Đã 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.