right_hand_event=grdetect(rightHand, fgbg_right, verbose=True)#检测右手手势识别事件 print('left hand: ', left_hand_event,'right hand: ', right_hand_event)#打印出来检测结果 主要看看grdetect和fgbg_left/fgbg_right: 看上图,除了手之外,还有个大背景,首先得把背景去掉,才能识别出前景色-手,fgb...
= collision_last: pygame.display.set_caption('rects collided={}'.format(collision_new)) collision_last = collision_new screen.fill((0, 0, 0)) pygame.draw.rect(screen, pygame.Color('red'), r1, 1) pygame.draw.rect(screen, pygame.Color('green'), r2, 1) pygame.display.flip() ...
Next, set the window size for your game. Keep in mind that not everyone has a big computer screen, so it's best to use a screen size that fits on "most" people's computers. There is a way to toggle full-screen mode, the way many modern video games do, but since you're just s...