Python,TO 冰冰

王吕泓  •  9个月前


from cpgzero import *
A=Actor("字母A")
B=Actor("字母B")
C=Actor("字母C")
D=Actor("字母D")
bb=Actor("俞冰轩")
bj=Actor("背景")
ts=Actor("tishi")
pen.text("下列不属于可再生能源的是",(-500,400),"red",80,"宋体")
pen.text("A.风能  B.太阳能  C.天然气  D.水能",(-600,200),"black",70,"宋体")
def clear():
    pen.clear()
def on_mouse_down(pos):
    if (C.collide_point(pos)):
        clear()
        bb.show = False
        ts.show = False
        A.show = False
        B.show = False
        C.show = False
        D.show = False
        bj.image="造型2"
        pen.text("很遗憾,答对啦",(-150,0),"red",60,"宋体")
        sound.play('胜利01')
    elif (A.collide_point(pos)):
        clear()
        bb.show = False
        ts.show = False
        A.show = False
        B.show = False
        C.show = False
        D.show = False
        bj.image="造型2"
        pen.text("哈哈,答错啦",(-150,0),"red",60,"宋体")
        sound.play('失败01')
    elif (B.collide_point(pos)):
        clear()
        bb.show = False
        ts.show = False
        A.show = False
        B.show = False
        C.show = False
        D.show = False
        bj.image="造型2"
        pen.text("哈哈,答错啦",(-150,0),"red",60,"宋体")
        sound.play('失败01')
    elif (D.collide_point(pos)):
        clear()
        bb.show = False
        ts.show = False
        A.show = False
        B.show = False
        C.show = False
        D.show = False
        bj.image="造型2"
        pen.text("哈哈,答错啦",(-100,0),"red",60,"宋体")
        sound.play('失败01')
    elif (bb.collide_point(pos)):
        clear()
        bb.show = False
        ts.show = False
        A.show = False
        B.show = False
        C.show = False
        D.show = False
        bj.image="造型2"
        pen.text("你有病吗,点我干嘛",(-250,0),"red",60,"宋体")
        sound.play('失败01')
    elif (ts.collide_point(pos)):
        clear()
        bb.show = False
        ts.show = False
        A.show = False
        B.show = False
        C.show = False
        D.show = False
        bj.image="造型2"
        pen.text("我嘞个骚杠,你小子想法不纯啊!!",(-450,0),"red",60,"宋体")
        sound.play('失败01')



评论: