• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天行健 君子當自強而不息

            Working with Maps and Levels(2)

            Using Character Map Lists in Your Game

            Using character map lists is a quick way to place characters in a map. When you
            load a map into memory, load the matching character map list and insert the characters.
            Although this method of adding characters to a map seems desirable, you’ll
            need a bit more flexibility at times, and that’s when using scripts comes into play.

             

            Script Placement

            As I said earlier in this section, you can also use scripts to insert characters into a
            map. Scripts give you more control over where and when a character is placed on
            a map than using direct placement does.

            For example, imagine that you want to track time in your game. At nighttime, all town
            vendors are at home, so the marketplace is empty. Guards are in the vendors’ places,
            so your game needs to know which characters to place—the vendors or the guards.

            You might notice that I’m coming up empty here by not defining a class for loading
            character placements on maps. How are your characters going to know where
            to be placed on your maps? As you might have guessed, you can use the Mad Lib
            Script system to create and incorporate an action template
            and a script processor into your project—the script processor then assumes the task
            of adding characters to the map based on the scripts you write for your game.

            A sample action template that adds characters to the map might look like this:

            “Add character # ~ to map at coordinates ~, ~, ~”
            INT 0 65535
            FLOAT -5000 5000
            FLOAT -5000 5000
            FLOAT -5000 5000

            With that single action defined, you can construct small scripts that place a character
            (by a unique identification number) on the map based on the X-, Y-, and Zcoordinates
            you provided. Quick, clean, and right to the point, scripting is definitely the way to go.

             

            Using Map Triggers

            Cause and effect—two words that say it all. In your world, nothing happens unless
            you specifically tell it to. Most events in your game happen when a character picks
            up an item, walks past a certain spot, or even tries to talk to another character.
            Those events are called triggers, and once a trigger has been signaled, a series of
            effects are sure to follow. Those effects usually take the form of a script being
            processed.

            The problem at this point isn’t dealing with the scripts, but figuring out how to
            trigger them. Programming a trigger for things like picking up an item is easy
            enough; just assign a number to the item description and process the appropriate
            script if that item is picked up. The same goes for talking to characters.

            Maps are a whole new deal. Maps come in all shapes and sizes, and trying to figure
            out when a character touches a certain spot on a map is the problem at this point.
            Well, I’m kidding, as that’s not really a problem. The trick is to mark sections of
            the map with geometric shapes that are used to quickly check whether a character
            steps inside the shape.

            The geometric shapes you want to use are spheres, boxes, cylinders, and triangles.
            Take a look at each one and how they all work out in the whole trigger scheme.


            posted on 2007-12-09 14:50 lovedday 閱讀(171) 評論(0)  編輯 收藏 引用

            公告

            導航

            統計

            常用鏈接

            隨筆分類(178)

            3D游戲編程相關鏈接

            搜索

            最新評論

            午夜精品久久久久久久| 久久久久综合国产欧美一区二区| 超级碰碰碰碰97久久久久| 久久久国产99久久国产一| 国内精品久久久久影院薰衣草 | 日本久久中文字幕| 18禁黄久久久AAA片| 国产精品对白刺激久久久| 久久久久99精品成人片三人毛片| 一本久道久久综合狠狠爱| 国产精品欧美亚洲韩国日本久久 | 亚洲精品乱码久久久久久| 欧美综合天天夜夜久久| 久久精品免费全国观看国产| 久久99热精品| 久久久久人妻一区二区三区vr| 久久久久噜噜噜亚洲熟女综合| 久久精品麻豆日日躁夜夜躁| 久久久久久久波多野结衣高潮 | 中文字幕久久欲求不满| 亚洲香蕉网久久综合影视| 性做久久久久久久久久久| 久久青青草原精品影院| 99久久中文字幕| 久久久亚洲欧洲日产国码二区| 亚洲愉拍99热成人精品热久久| 亚洲综合久久夜AV | 久久精品夜色噜噜亚洲A∨| 狠狠狠色丁香婷婷综合久久五月| 亚洲第一极品精品无码久久| 久久精品中文无码资源站| 精品久久久无码人妻中文字幕| 国产香蕉久久精品综合网| 中文成人无码精品久久久不卡 | 99久久超碰中文字幕伊人| 男女久久久国产一区二区三区| 久久亚洲精品无码aⅴ大香| 亚洲αv久久久噜噜噜噜噜| 99蜜桃臀久久久欧美精品网站 | 狠狠综合久久综合88亚洲| 亚洲伊人久久大香线蕉综合图片|