用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字

云代码会员    -  云代码空间

——

画画

2021-10-15|472阅||

摘要:# 倾听音乐:享受生活。快乐每一天! import pygame import os import sys import time import easygui as es from pygame.locals import * import tkinter.messagebox

# 倾听音乐:享受生活。快乐每一天!
import pygame
import os
import sys
import time
import easygui as es
from pygame.locals import *
import tkinter.messagebox
 
print("加载中...")
pygame.time.wait(5000)
import Loding
pygame.time.wait(10000)
 
es.msgbox(msg = """
此程序仅支持在Windows平台的cmd窗口运行,如果在别的系统或别的程序下运行可能会运行失败或者效果变差!
 
This program only supports running in the CMD window of Windows platform.
If it is run under other systems or other programs,it may fail or the effect may become worse !"""
          ,title = """
提示(Tips)
 
                       """
          ,ok_button =
"""
我知道了
OK
""")
 
size = 1024,625
imge_size = 1024,625
 
  
pygame.init()
print(pygame.get_sdl_version())
pygame.time.wait(2000)
pygame.time.delay(2000)
 
 
times = pygame.time.get_ticks()/1000
es.msgbox(msg="You have loaded a totla of:"+str(times)+"second"
,title="Loading time"
,ok_button="OK")
 
  
pygame.mixer.init()
 
es.msgbox(msg = """
======================================================================
Music address:./素材/音乐/
Music List:
消愁-毛不易.mp3  爆爽游戏音乐.ogg  冬眠.mp3  踏山河.mp3  Dont'touch.mp3
 
======================================================================       
"""
,ok_button = "I have found a piece of music I like"
             ,title = "Music List")
 
 
musci_files = input("Please enter the full music path:")
pygame.mixer.music.load(musci_files)
pygame.mixer.music.set_volume(0.6)
pygame.mixer.music.play(-1,0)
pygame.mouse.set_pos(249,212)
 
scenn = pygame.display.set_mode(size)
pygame.display.set_caption("倾听音乐:享受生活!")
img = pygame.image.load("./素材/图片/imgs.jpeg")
pygame.display.update()
while True:
    for event in pygame.event.get():
        if event == quit:
            pygame.quit()
            exit()
        pygame.display.update()
        os.system("cls")
        print("Mouse current coordinates is :",pygame.mouse.get_pos())
        starts = pygame.key.get_focused()
       
        if starts == 1:
            print("Your music is playing...")
            pygame.mixer.music.unpause()
        else:
           
            pygame.mixer.music.pause()
            print("The music has paused. You need to point the cursor at the music player and press it to continue playing...")
        print(pygame.mixer.music.get_busy())
        scenn.blit(img,(0,0))


顶 0踩 0收藏
文章评论
    发表评论

    个人资料

    • 昵称: 云代码会员
    • 等级: 初级程序员
    • 积分: -102
    • 代码: 2 个
    • 文章: 3 篇
    • 随想: 0 条
    • 访问: 1 次
    • 关注

    人气文章

    人气代码

    标签

    最新提问

      站长推荐