Exemplo n.º 1
0
 def self_destruct(self):
     self.delete_this_clone()
     # For the "original" instance, the delete_this_clone() call should be
     # a no-op, so we should keep going.  The wait_seconds() call is to
     # test that we can get into the scheduler and back out again.
     pytch.wait_seconds(0.1)
     self.kept_running = 'yes'
Exemplo n.º 2
0
 def award_point(self):
     if self.get_x() > 225:
         GlobalVariables.score_1 += 1
     else:
         GlobalVariables.score_2 += 1
     self.hide()
     pytch.broadcast_and_wait('Update_Score')
     pytch.wait_seconds(0.75)
Exemplo n.º 3
0
 def play_game(self):
     self.score = 0
     self.go_to_random_spot()
     self.switch_costume('balloon')
     self.show()
     while True:
         pytch.wait_seconds(3.0)
         self.go_to_random_spot()
         self.show()
Exemplo n.º 4
0
 def move(self):
     self.change_x(50)
     pytch.wait_seconds(0.5)
     self.change_x(60)
Exemplo n.º 5
0
 def note_event(self):
     self.n_events += 1
     pytch.wait_seconds(0)
     self.n_events += 1
Exemplo n.º 6
0
 def invade(self):
     self.n_steps += 1
     pytch.wait_seconds(0.25)
     self.n_steps += 1
Exemplo n.º 7
0
 def note_click(self):
     self.n_clicks += 1
     pytch.wait_seconds(0)
     self.n_clicks += 1
Exemplo n.º 8
0
 def move(self):
     self.change_x(50)
     print('moved once')
     wait_seconds(0.5)
     self.change_x(50)
     print('moved twice')
Exemplo n.º 9
0
 def delayed_fail(self):
     pytch.wait_seconds(0.25)
     print(no_such_variable)
Exemplo n.º 10
0
 def delayed_fail(self):
     pytch.wait_seconds(0.25)
     pytch.no_such_function()
Exemplo n.º 11
0
 def delayed_fail(self):
     pytch.wait_seconds(0.25)
     print(1 / 0)