예제 #1
0
    def on_touch_up(self, touch):
        v = Vector(touch.pos) - Vector(touch.opos)
        if v.length < 20:
            return
        if abs(v.x) > abs(v.y):
            v.y = 0
        else:
            v.x = 0

        self.move(*v.normalize())
예제 #2
0
    def on_touch_up(self, touch):
        v = Vector(touch.pos) - Vector(touch.opos)
        if v.length() < 20:
            return

        if abs(v.x) > abs(v.y):
            v.y = 0
        else:
            v.x = 0

        self.move(*v.normalize())
예제 #3
0
파일: main.py 프로젝트: henrylei2000/cs
    def on_touch_up(self, touch):
        v = Vector(touch.pos) - Vector(touch.opos)
        if v.length() < self.columns:
            return

        if abs(v.x) > abs(v.y):
            v.y = 0
        else:
            v.x = 0
        if not self.game_over:
            self.move(*v.normalize())