- 论坛徽章:
- 5
|
本帖最后由 __BlueGuy__ 于 2012-10-20 23:09 编辑
这个设计有什么优缺点, 你会怎么设计? 怎么重写... ?
这是我从某手机游戏里 copy出来的代码? 大家评论一下,
这些都属于机密文件,很有价值的,我都是冒着商业风险拿出来讨论的...
- public class FSprite implements GameData
- {
- Image[] images;
- short[][] modules;
- short[][] attrectdata, beattrectdata;
- short[][][] frames;
- byte[][][] actions,
- attackdata, //攻击数据
- effectdata; //特效数据
- GameCanvas canvas;
- boolean isdrawsprite;
- byte actionstate, actionIndex, actionFrameindex, frameDelay;
- byte faceto;
- short spritex, spritey, spritez; //角色位置
- short xspeed, axspeed, yspeed, ayspeed, zspeed, azspeed;
- byte hdirection, vdirection;
- byte alivestate;
- byte spritePRI;
- byte spriteType;
- byte spriteboxindex;
- byte spritename;
- boolean isactionover;
- byte attackindex, attacklevel, attackareaz;
- byte attackstate, attacktype, attackefftype, attackhitnum, attackdebufindex, hittype;
- short attackhurtpercent;
- byte hitEnemyIndex;
- byte hurtstate;
- short appendhurt;
- boolean isheavyhurt;
- byte debuff;
- Role user, actonrole;
- byte attackdelay;
复制代码
- public class Role extends FSprite implements GameData
- {
- HeadPopUp[] hpp = new HeadPopUp[5];
- short[] baseshengming = new short[2],//生命
- shengming = new short[2],
-
- basefali = new short[2],//法力
- fali = new short[2],
-
- baseminjie = new short[2],//敏捷
- minjie = new short[2],
-
- basefangyu = new short[2],//防御
- fangyu = new short[2],
-
- basewugong = new short[2],//物攻
- wugong = new short[2],
-
- basefagong = new short[2],//法攻
- fagong = new short[2],
-
- basebaoji = new short[2],//爆击
- baoji = new short[2];
-
- short currenthmovespeed;
- byte aiType, aiLoop;
- byte wuditime;
- boolean aiLeft;
- Vector behurtinfo;
- short roleh;
- short[][] aidata;
- short alivetime;
- short[] attackcd;
- byte attackholdtime; //普通攻击按键时间
- byte batistate;//是否霸体
- byte walkxspeed, walkzspeed;
- byte level;
- boolean isFlushed;
- }
复制代码
- public class Effect extends FSprite
- {
- byte alivetype, alivetime, xstate, ystate, zstate;
- }
复制代码 |
|