예제 #1
0
 def right(self):
     if random.randrange(0, 3) == 1:
         press_key(W)
     else:
         release_key(W)
     press_key(D)
     release_key(A)
     release_key(S)
예제 #2
0
    def reset(self):
        shift = 0x2A
        f = 0x21
        # r = 0x13

        release_key(W)
        release_key(A)
        release_key(D)
        press_key(shift)
        press_key(f)
        release_key(shift)
        release_key(f)

        self.reward -= 1.
        self.current_screen = None
        self.done = True

        for i in list(range(2))[::-1]:
            print(i + 1)
            time.sleep(1)
예제 #3
0
 def reverse(self):
     press_key(S)
     release_key(A)
     release_key(W)
     release_key(D)
예제 #4
0
 def straight(self):
     press_key(W)
     release_key(A)
     release_key(D)
     release_key(S)