- 1、本文档共6页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
游戏中的地图(Maps in the game)
游戏中的地图(Maps in the game)
The map in the game 2009-03-03 21:59 on the map:
Legend of Sword and Fairy map block (Tile) size is 32X16 (in pixels).
The actual size of each block is 32x15 (in pixels), and stitching is just perfect.
The map size is 128x128 (in block plots).
The arrangement is as follows:
02468...... / / zeroth
13579......
02468...... / / first
13579......
The advantage of this approach is that it is easy to determine where the blocks are visible within the screen and only visible portions are visible at a time.
The map is divided into two layers, the bottom and the surface. Each block attribute occupies 4 bytes (2 bytes at the bottom and on the surface).
So the size of the entire map is 128x128x4=64K bytes. Thats a coincidence, isnt it? DOS under memory, a paragraph is so big)
The properties of each block are as follows:
Typedef struct
{
Unsigned No:8; / / block number
Unsigned Height:4; / / block height
Unsigned Add:1; / / block number high
Unsigned Block:1; / / obstacle marker (here can not go, such as the wall)
Unsigned Actor:1; / / character mark (someone here NPC)
Unsigned Switch:1; / / map switching sign (people come here to switch to another scene)
} TCell;
Notes:
1, GroundNo = 4, if GroundAdd = 1, then the actual GroundNo + = 256, GroundNo = 300.
2, each map up from 2 (8+1) 512 square blocks into different work. In actual applications, about 300 maps are used for each map.
3, the characters are about 3 blocks high, so the 4 bit Height is enough to deal with the occlusion effects of characters and scenes.
About characters:
Characters are located between the bottom and the surface. The height of the block is used to deal with the relationship between the characters and the scene.
However, there are also relations between characters, how to deal with it?
My method is to create a character list, using the painter algorithm.
The relationship between characters is easy to calculate: first compare Y, and then compare X, small first painting.
However, suc
您可能关注的文档
- 春熙路和建设路停车(Parking in Chunxi Road and Jianshe Road).doc
- 春夜宴从弟桃花园序(A feast from the little garden order).doc
- 春节祝酒辞(Spring Festival toast).doc
- 春秋和战国时期(The spring and Autumn period and the Warring States Period).doc
- 春节期间隼鹳提高排cburstoutlughingontrrytoonese盼望着做某事xpecttion名的妙招(During the Spring Festival, the Falcon stork raised the platoon cburstoutlughingontrrytoonese looking forward to doing something xpecttion's coup).doc
- 春节祝福语(Spring Festival greetings).doc
- 显卡小知识(Graphics knowledge).doc
- 显卡必读(Graphics must read).doc
- 显示器分辨率 各尺寸液晶分辨率汇总(Display resolution, size, LCD resolution summary).doc
- 显示器维护保养技巧(Display maintenance skills).doc
文档评论(0)