Đang chuẩn bị liên kết để tải về tài liệu:
Visual C# Game Programming for Teens phần 9

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Các chương trình giới thiệu Cổng thông tin tìm kiếm tài sản Collidable ngói và các báo cáo trên màn hình khi một gạch collidable được xác định. Hình 9,6 cho thấy các thông điệp được in khi người chơi đi qua một collidable | 358 Chapter 13 Equipping Gear and Looting Treasure Items Class The Items class is a helper class to handle the items database. The Items class reads in the entire .item file and is used to drop items when a monster is killed as well as to show items in the player s inventory. So this class is very important it keeps our main code tidy by providing a very useful helper function called getItem . When creating an object using this class during program initialization be sure to use Load to load the .item file needed by the game. This should be the same .item file you used to specify drop items in the character editor. public class Items keep public for easy access public List Item items public Items items new List Item private string getElement string field ref XmlElement element string value try value element.GetElementsByTagName field 0 .InnerText catch Exception return value public bool Load string filename try open the xml file XmlDocument doc new XmlDocument doc.Load filename XmlNodeList list doc.GetElementsByTagName item foreach XmlNode node in list Looting Treasure 359 get next item in table XmlElement element XmlElement node Item item new Item store fields in new Item item.Name getElement name ref element item.Description getElement description ref element item.DropImageFilename getElement dropimagefilename ref element i tem.InvImageFilename getElement invimagefilename ref element item.Category getElement category ref element i tem.Weight Convert.ToSingle getElement weight ref element item.Value Convert.ToSingle getElement value ref element item.AttackNumDice Convert.ToInt32 getElement attacknumdice ref element item.AttackDie Convert.ToInt32 getElement attackdie ref element item.Defense Convert.ToInt32 getElement defense ref element item.STR Convert.ToInt32 getElement STR ref element item.DEX Convert.ToInt32 getElement DEX ref element item.STA Convert.ToInt32 getElement STA ref element item.INT Convert.ToInt32 getElement INT ref element item.CHA Convert.ToInt32

Đã 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.