示例#1
0
文件: main.py 项目: Zen-CODE/kivybits
 def update(self, dt):
     if self.expired: return True
     pos = Vector(self.pos)
     pos.y = pos.y + self.delta * dt
     self.pos = pos.x, pos.y
     self.incState()
     self.expiryCheck()
     return self.expired
示例#2
0
 def update(self, dt):
     if self.expired: return True
     pos = Vector(self.pos)
     pos.y = pos.y + self.delta * dt
     self.pos = pos.x, pos.y
     self.incState()
     self.expiryCheck()
     return self.expired
    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())
示例#4
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())
示例#5
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())