用户:
乐观的蓝雀Lbqx查看:0 回复:0 评论:0 创建时间:2021-12-11T10:08:01
【作品展示】

【作品介绍】
做出房子!!!!挣钱!!!!
@GoldenEggs
【作品源代码】
import cv2
import time
import turtle
import random
import pygame
__Pen = turtle.Pen()
__screen = turtle.Screen()
#开始进入Python的世界
pygame.mixer.init()
pygame.mixer.music.load("开头.mp3")
pygame.mixer.music.play()
print('你是宇泽房地产中的建筑高手')
time.sleep(4)
__Pen.write('贫穷', font = ('Arial', 80, 'normal'))
print('只不过没什么钱而已……')
__screen.title("开始抽奖")
print('不过现在您迎来了转机,打开补给箱领取资金')
__Pen.clear()
def money():
a = random.randint(1,11)
b = a*50
print("恭喜你获得了",b,"元")
return b
money()
while True:
pygame.mixer.music.stop()
pygame.mixer.init()
pygame.mixer.music.load("1.mp3")
pygame.mixer.music.play()
Q = __screen.textinput("选择房子","火葬房:50 机关房:100 简单房:150 下一页")
if Q == "火葬房":
if money() >= 50:
cap = cv2.VideoCapture('火葬.mp4')
pygame.mixer.init()
pygame.mixer.music.load("火葬在.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 50
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif Q == "机关房":
if money() >= 100:
cap = cv2.VideoCapture('机关房.mp4')
pygame.mixer.init()
pygame.mixer.music.load("机关房在.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 100
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif Q == "简单房":
if money() >= 150:
cap = cv2.VideoCapture('简单房.mp4')
pygame.mixer.init()
pygame.mixer.music.load("简单房在.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 150
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif Q == "下一页":
pygame.mixer.music.stop()
pygame.mixer.init()
pygame.mixer.music.load("2.mp3")
pygame.mixer.music.play()
W = __screen.textinput("选择房子", "蜗居房子:200 水井坊:250 悬崖峭璧房:300 下一页")
if W == "蜗居房子":
if money() >= 200:
cap = cv2.VideoCapture('蜗居房子.mp4')
pygame.mixer.init()
pygame.mixer.music.load("蜗居房子在.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 200
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif Q == "水井坊":
if money() >= 250:
cap = cv2.VideoCapture('水井坊.mp4')
pygame.mixer.init()
pygame.mixer.music.load("水井坊在.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 250
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif W == "悬崖峭璧房":
if money() >= 300:
cap = cv2.VideoCapture('悬崖峭壁房.mp4')
pygame.mixer.init()
pygame.mixer.music.load("悬崖峭壁房在.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 300
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif W == "下一页":
pygame.mixer.music.stop()
pygame.mixer.init()
pygame.mixer.music.load("3.mp3")
pygame.mixer.music.play()
E = __screen.textinput("选择房子","迷宫房子:350 抵御巨人房:450 水立方:550 下一页")
if E == "迷宫房子":
if money() >= 350:
cap = cv2.VideoCapture('迷宫房子房子.mp4')
pygame.mixer.init()
pygame.mixer.music.load("迷宫房子.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 350
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif E == "抵御巨人房":
if money() >= 450:
cap = cv2.VideoCapture('抵御巨人房在.mp4')
pygame.mixer.init()
pygame.mixer.music.load("抵御巨人房.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 450
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif E == "水立方":
if money() >= 550:
cap = cv2.VideoCapture('水立方.mp4')
pygame.mixer.init()
pygame.mixer.music.load("水立方房子.mp3")
pygame.mixer.music.play()
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('image', frame)
k = cv2.waitKey(20)
#q键退出
if (k & 0xff == ord('q')):
break
b = b - 550
cap.release()
cv2.destroyAllWindows()
pygame.mixer.music.stop()
elif E == "下一页":
print(" _ ")
turtle.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn