Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
类似于雷霆战机,飞机向左边飞时,有向左边飞的动画,向右边飞时,也有向右边飞行的动画,如果长按住动弹幅度很小,则为正视图动画。现在动画全画好了,问题是,该怎么用逻辑精准实现飞机向左飞还是向右飞的动画呢?
@雄哥出击 拖拽能力吗?那可以试试找个变量,用来记录一下上一帧的x坐标,然后写事件,只要这个变量的值不等于飞机当前的x坐标,就判断这个变量的值是比飞机当前的x坐标大还是小,比当前x坐标大说明飞机往左飞,反过来说明往右飞,根据情况来设置动画,判断完再设置这个变量的值为飞机当前的x坐标值就行
@牙白desune 谢谢你!茅塞顿开了。