Commit 4cf7e9c7 by BellCodeEditor

auto save

parent 810064b5
Showing with 61 additions and 9 deletions
class wgzl:
def __init__(self,name,Hp,Gj):
self.name=name
self.Hp=Hp
self.Gj=Gj
def Sj(self):
self.Hp=self.Hp+50
self.Gj=self.Gj+10
Lk=wgzl("林克",1500,180)
Serd=wgzl("塞尔达",1100,80)
Gn=wgzl("加侬多夫",8000,900)
bkbl=wgzl("波克布林",100,50)
a=input("请输入想查询英雄名字")
if a =='Lk':
print(Lk.name,"血量",Lk.Hp,"攻击",Lk.Gj)
if a =='Serd':
print(Serd.name,"血量",Serd.Hp,"攻击",Serd.Gj)
if a =='Gn':
print(Gn.name,"血量",Gn.Hp,"攻击",Gn.Gj)
if a =='bkbl':
print(bkbl.name,"血量",bkbl.Hp,"攻击",bkbl.Gj)
Serd.Sj()
print("血月升起,已升级该英雄")
print(Serd.name,"血量",Serd.Hp,"攻击",Serd.Gj)
\ No newline at end of file
import pygame
from pygame import locals
import os
pygame.init() # 初始化
# 创建窗口
......@@ -13,8 +14,16 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 载入音乐
pygame.mixer.music.load('歌曲1.wav') # 载入音乐
pygame.mixer.music.load('两只老虎-歌曲.url')
#pygame.mixer.music.load('歌曲1.wav') # 载入音乐
music_list = []
path = 'C:\\Users\\86132\\Desktop\\LEGO Software'
wenjian = os.listdir(path)
for i in wenjian:
if i[-4:]=='.wav':
music_list.append(i)
num = -1
volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
......@@ -50,15 +59,29 @@ while True:
else:
play_button = play_img
pygame.mixer.music.pause()
if x >120 and x < 220 and y > 350 and y < 400:
num -= 1
if num < 0:
num = len(music_list) - 1
pygame.mixer.music.load(path+'\\'+music_list[num])
pygame.mixer.music.play()
click = 0
play_button = stop_img
if x >420 and x < 520 and y > 350 and y < 400:
num += 1
if num > len(music_list) - 1:
num = 0
pygame.mixer.music.load(path+'\\'+music_list[num])
pygame.mixer.music.play()
click = 0
play_button = stop_img
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(path+'\\'+music_list[num])
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
pygame.display.update()
scree
\ No newline at end of file
[InternetShortcut]
[InternetShortcut]
URL=orpheus://orpheus/pub/app.html#/m/artist/?id=13193
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment