我似乎无法理解它需要什么键。使用 Node,remove_all_actions 就像删除所有东西一样。所以我需要一些可以阻止特定行动的东西。
这是我测试的代码:
import sound
import random
import math
A = Action
class MyScene (Scene):
def setup(self):
self.node = SpriteNode('emj:Alien',parent=self,position=(self.size.w,self.size.h))
self.node.run_action(A.move_to(0,0,10))
def did_change_size(self):
pass
def update(self):
pass
def touch_began(self, touch):
self.node.remove_actions() #<-----------What is the key here to stop self.node from moving. The error said “_Scene.Node hasn’t no attribute”
def touch_moved(self, touch):
pass
def touch_ended(self, touch):
pass
if __name__ == '__main__':
run(MyScene(), show_fps=False)```