示例#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'
示例#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)
示例#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()
示例#4
0
 def move(self):
     self.change_x(50)
     pytch.wait_seconds(0.5)
     self.change_x(60)
示例#5
0
 def note_event(self):
     self.n_events += 1
     pytch.wait_seconds(0)
     self.n_events += 1
示例#6
0
 def invade(self):
     self.n_steps += 1
     pytch.wait_seconds(0.25)
     self.n_steps += 1
示例#7
0
 def note_click(self):
     self.n_clicks += 1
     pytch.wait_seconds(0)
     self.n_clicks += 1
示例#8
0
 def move(self):
     self.change_x(50)
     print('moved once')
     wait_seconds(0.5)
     self.change_x(50)
     print('moved twice')
示例#9
0
 def delayed_fail(self):
     pytch.wait_seconds(0.25)
     print(no_such_variable)
示例#10
0
 def delayed_fail(self):
     pytch.wait_seconds(0.25)
     pytch.no_such_function()
示例#11
0
 def delayed_fail(self):
     pytch.wait_seconds(0.25)
     print(1 / 0)