开发者

how can i do a hitest with 2 classes

how can i make a hitest with 2 classes 1 class is called enemy and the second is called player they both are movieclip classes and the movieclips have instances of the enemy class movieclip = Enemy and the player class movieclip = Player

can you give me the code please ive been stuck on this 2 day开发者_JAVA百科s now please help

thanks fastboy619 of the actionscript.org forum


This is very simple. Below is a link to a tutorial + an excerpt from the tutorial of the code that is specifically performing this op:

if (circle.hitTestObject(square)) {
     hittext.text = "Ouch!";
} else {
     hittext.text = "";
}

http://www.foundation-flash.com/tutorials/as3hittesting/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜