制作as3龙息
好吧,我有一个名为 dracoplay 的MC,里面有另一个名为 Drakep 的MC,里面还有另一个名为 wing 和 head 的MC,你可能已经猜到它们组成了一条龙。所以 dracoplay 是被编码的角色。 Drakp 是身体,头部和翅膀有动画。现在我的问题是让它喷火,这样它就会一直开火,直到我松开左键(我已经找到了一种方法,当我单击时它会开火,但我必须再次单击才能停止)。我还想让它向鼠标射击。
Ok i have a mc called dracoplay and inside is another mc called Drakep and inside that there is another mc called wing and head as you may have guessed they make up a dragon. So dracoplay is the character that gets coded. Drakp is the body and the head and wing have animations. Now my problem is making it breath fire so that it will keep firing until i let go of the left click (I already found a way for it fire when i click but i have to click again for it to stop). I would also like for it to shoot towards the mouse.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我所看到的,您应该使用两个事件监听器,一个 mouseDown 和 mouseUp-event :) 我将编写一些基本代码来帮助您。
这两个事件监听器应该添加到代码的构造函数中。然后,toggleFire 方法将如下所示:
您需要的最后一个函数是 BreathFire 函数。
这应该可以解决问题。
from what i'm seeing, you should use two eventListeners, a mouseDown and mouseUp-event :) I'll write some basic code that should help you.
these two eventListeners should be added in the constructor of your code. Then, the toggleFire-method will look like this:
the last function you need is the breatheFire-function.
and this should do the trick.