Một trong những mục tiêu thiết lập khi phát triển FallFury đã làm cho các trò chơi mở rộng trong trường hợp có thể chơi cấp độ. Hơn nữa, tôi nghĩ rằng nó sẽ làm cho cảm giác từ sự phát triển và thử nghiệm quan điểm có mức độ như một thực thể hoàn toàn riêng biệt có thể được thay đổi khi cần thiết. Ví dụ, khi một quyền lực-up mới đã được giới thiệu, tôi muốn thêm một thêm dòng trong một tập tin cấp và kiểm tra nó ra. Điều này cuối cùng đã đạt được bằng cách tạo ra một XML dựa trên mức độ động cơ và trong bài viết này tôi sẽ mô tả quá trình cấp cấu trúc và thiết kế. Những bước đầu tiên Khi tôi bắt đầu làm việc trên các khái niệm cấp động cơ, tôi bắt đầu thiết kế cấu trúc file XML tiềm năng cho các cấp độ và kết thúc với các yêu cầu sau: Level Type Identifier – As different levels have different backgrounds and sound themes, there should be a way to mark a level type. There are currently four level types: dream, nightmare, space, and magic bean. The Starting Character Descriptor – When the game starts, the teddy bear has some initial, basic properties, such as maximum health level, horizontal position, and velocity. A Collection of Obstacles – For each level, obstacles are positioned differently, and it’s important to specify that. For some obstacles it might be desirable to disable the damage infliction component, while for others it might be good to maximize the damage caused by colliding with them. Also, there are multiple textures associated with different obstacle types, so I wanted to specify the obstacles to render regardless of the selected level type. A Collection of Monsters – Obstacles are not the only component that can damage the bear during gameplay. There are also monsters that can pop up and shoot at the main character. Similar to the bear, monsters represent a living entity and have some specific properties, such as the initial health, damage, starting position, velocity, and type. Buttons – These are the bonus point boosters in FallFury. The player collects as many of those as possible, and each of them should be individually positioned to form either a trail or a shape. Power-Ups – With the basic set of abilities, the bear is able to get some bonuses such as a cape that will speed-up his descent or a bubble that will protect him from incoming shells. The first build of the level engine integrated into FallFuryused percentage-based relative values to position elements on the screen. Although this seemed like a good idea at the time, it became problematic because It required the level to be a fixed size, which restricted element addition and level extension. 51 | Fall Fury It caused problems with obstacles that needed to be scaled and therefore had a non-standard size. Small modifications were harder to make because minimal adjustments would throw off the relative position. So, I switched to a pixel-based conditioning in which each position is relative to zero. With this in place, levels can be infinitely long (within the context of the machine’s rendering and memory capabilities)and extra elements can be more seamlessly added. Additionally, levels need to be packaged together in individual sets, normally grouped by themes, without restriction. This is achieved with the help of an extra XML file,called core.xml, which keeps track of level tiers, and acts as a container that allows the developer to name and easily enable or disable specific levels . The structure for the core.xml file looks like this:Tiers that are commented out are ignored and the included levels aren’t on the game list. Also, the paths indicated for each file attribute—for each individual tier—are relative to the game folder itself. There is no limit on the number of subfolders that can be included in the path. The above structure will render this level set:
đang được dịch, vui lòng đợi..