Actionscript 3 as3中的塔防游戏帮助
我一直在编写一个塔防游戏的教程(),但我在绘制第二张地图/道路时遇到了麻烦。我已经能够改变道路了。(如果你还没有从源文件中发现他在MagicTD文件中给出了this.points=[[uu]]这个值),我已经替换了Actionscript 3 as3中的塔防游戏帮助,actionscript-3,flash-cs4,Actionscript 3,Flash Cs4,我一直在编写一个塔防游戏的教程(),但我在绘制第二张地图/道路时遇到了麻烦。我已经能够改变道路了。(如果你还没有从源文件中发现他在MagicTD文件中给出了this.points=[[uu]]这个值),我已经替换了 this.points = [[2, -1], [2, 5], [6, 5], [6, 16], [28, 16], [28, 4], [12, 4], [12, 19], [22, 19], [22, 12], [36, 12]]; this.grid_si
this.points = [[2, -1], [2, 5], [6, 5], [6, 16], [28, 16], [28, 4], [12, 4], [12, 19], [22, 19], [22, 12], [36, 12]];
this.grid_size = 16;
// this.setupTarget();
this.drawBackground();
this.setupMap();
this.setupTimers();
this.setupListeners();
与
和(map1btn是一个按钮)并单击MP1
public function clickmp1(event:MouseEvent) {
this.points=[[1,-1],[2,5],[6,5],[6,16],[28,16],[28,4],[12,4],[12,19],[22,19],[22,12],[36,12]];
this.setupTimers();
this.drawBackground();
this.setupMap();
this.setListeners();
}
(检查源文件中的其余()项)
发生的事情是敌人正在地图和网格下行进
谢谢
雷神听起来你需要把地图放回一切后面。要做到这一点,您可以采取以下措施:
this.setChildIndex(yourMapInstanceName, 0);
这假设所有涉及的内容都将“This
”作为公共父项
或者,在所有东西的上面扔东西:
this.setChildIndex(yourMapInstanceName, this.numChildren - 1);
谢谢工作得很好。刚做了这个.setChildIndex(this.backgroundMC,0);用于背景和this.setChildIndex(this.map,1);上路
this.setChildIndex(yourMapInstanceName, this.numChildren - 1);