tailieunhanh - microsoft visual basic game programming for teens phần 4

vì vậy bạn có thể tham khảo các thành phần DirectX từ bên trong Visual Basic. Chương này là ngắn về chi tiết nhưng cao trên ý tưởng, trình bày một cái nhìn thoáng qua của Crusader Celtic trò chơi, một game nhập vai mà bạn tạo ra trong khi sau cùng trong cuốn sách này từ một trong những chương tiếp theo, | 100 Chapter 6 The Basics of Tile-Based Scrolling Figure illustrates the concept of scrolling which in essence involves the use of a large game world of which only a small portion is visible through the screen at a time. The key to scrolling is having something in the virtual game world to display in the scroll window or the screen . Also I should point out that the entire screen need not be used as the scroll window. It is common to use the entire screen in scrolling-shooter games but role-playing games RPGs often use a smaller window on the screen for scrolling using the rest of the screen for gameplay combat inventory and so on and player party information as shown in Figure . You could display one huge bitmap image in the virtual game world representing the current level of the game or the map and then copy a portion of that virtual world onto the screen. This is the simplest form of scrolling. Another method uses tiles to create the game world at runtime which I cover in the next two chapters. First you write a short program that demonstrates how to use bitmap scrolling as this is an important first step to understanding the process and one might argue a good enough method in and of itself for creating a scrolling game. A Limited View of the World 101 Figure Some games use a smaller portion of the game screen for a scrolling window. A Limited View of the World I have written a program called Scrollscreen to show you. The sources chapter06 ScrollScreen folder on this book s CD-ROM contains the file used in this program. Although I encourage you to write the program yourself you may load the project file off the CD-ROM if you wish or I should say if you are feeling lazy . Figure shows the bitmap file. When you run the ScrollScreen program it loads the image into the virtual buffer which is a Direct3D surface and displays the upper-left corner in the 800 X 600 screen. You can change the resolution if you .

TỪ KHÓA LIÊN QUAN