Course Notes_Zero-based introductory learning Python_007_Amazing branch and loop 1

Amazing branches and loops 1

  • Screenshots of the plane flying game

Insert picture description here

  • Fighting plane game frame

加载背景音乐
播放背景音乐(设置单曲循环)
我方飞机诞生
while True:
    if 用户是否点击了关闭按钮:
       推出程序
       
    interval += 1;
    if interval == 50:
       interval = 0;
       小飞机诞生
    小飞机移动一个位置
    屏幕刷新
    
    if 用户鼠标产生移动:
       我方飞机中心位置 = 用户鼠标位置
       屏幕刷新
       
    if 我方飞机与小飞机发生肢体冲突:
       我方挂,播放撞机音乐
       修改我方飞机图案
       打印“Game over"
       停止背景音乐,最好淡出

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_41754258/article/details/113922523