TAILIEUCHUNG - Visual C# Game Programming for Teens phần 6

cổng thông tin. Trong chương trình của chúng tôi, phím Space là kích hoạt. Khi cổng thông tin là tham gia, người chơi sẽ được chuyển đến tọa độ mục tiêu (101,16), như thể hiện trong hình . Hình Các cổng thông tin đã gửi các cầu thủ trên bản đồ! | It s a Data-Driven Game World 217 Figure The portal has sent the player across the map portal. In our program the Space key is the trigger. When the portal is engaged the player is teleported to the target coordinate 101 16 as shown in Figure . Trick Getting tired of the same old ground tiles in every example Replace them You are encouraged to use a different set of ground tiles or add new ones to this collection. I am only using these same tiles for consistency. You may replace the tiles in the level editor and in the game. The only requirement is that your tile palette image be oriented like the one presented in the book and that the tiles remain at 32x32 pixels in size. Otherwise some coding changes will be needed. Looking for Tile Collisions The Portal demo program also looks for the Collidable property in tiles and reports on the screen when a collidable tile is identified. Figure shows the message that is printed when the player walks over a collidable tile. Although the 218 Chapter 9 Going Deeper into the Dungeon with Portals Figure Detecting collidable tiles. sprite doesn t respond to collidable tiles yet in this example we can use this information to enable collision response in the next major revision to the game. Hint This quick example is not quite polished yet so expect to see some jittery sprites and timing problems. The point is to get these features to work first and then make them work great afterward Secret Doors With the portal system working we can now use it to create secret doors to appear to walk through walls A portal is just a tile property that defines a target location for the player to be moved to. If you set the target for a portal to a tile just one or two spaces away then it can appear as if the player is hopping over It s a Data-Driven Game World 219 an obstacle. You could use this technique to get past solid objects or walls which would be even more effective if a trigger object or key is required. Portal Demo Program

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.