What all things happens inside pygame when I press a key? When to use pygame.event==KEYDOWN
问题 I have been trying to code a small 2D game using python. checkp_list[0]=head_pos pressed_key= pygame.key.get_pressed() if pressed_key[pygame.K_ESCAPE]: running=False if pressed_key[pygame.K_UP]: if dir_ not in ["up", "down"]: dir_= "up" checkp_no= checkp_no+1 #head_pos_next=head_move(head_pos, dir_) checkp_list.insert(checkp_no,head_pos) log_file_obj.write("chekp_list {}, checkp_no {} after append dir {}\n".format(checkp_list,checkp_no,dir_)) if pressed_key[pygame.K_DOWN]: if dir_ not in ["up