我正在制作游戏。在游戏中你杀死了敌人。我在屏幕上设置了20个敌人。当你杀死其中一个时,屏幕顶部的栏必须显示剩下的19个敌人。然后剩下18个敌人。但它不起作用。你能救我吗?
这是我的代码:
if(this.visible==true){
if(MovieClip(root).kalanDusmanSayisi>=0){
MovieClip(root).oluDusmanSayisi-1
this.visible=false
MovieClip(root).elsilah.gotoAndStop(1)
if(MovieClip(root).kalanDusmanSayisi==-1){
MovieClip(root).kalanDusmanSayisi=0
}
MovieClip(root).kalanDusmanSayisi=MovieClip(root).toplamDusmanSayisi+MovieClip(root).oluDusmanSayisi-1
MovieClip(root).rapor.text=MovieClip(root).kalanDusmanSayisi.toString()+ " kişi kaldı!"
}else{
removeEventListener(Event.ENTER_FRAME,dusmanZekasi)
Mouse.show()
var rpg:URLRequest=new URLRequest("3. Bölüm.swf")
var rpgyukleyici:Loader=new Loader()
rpgyukleyici.load(rpg)
stage.addChild(rpgyukleyici)
stage.removeChildAt(0)
}
答案 0 :(得分:0)
第三行: 影片剪辑(根).oluDusmanSayisi = MovieClip的(根).oluDusmanSayisi-1