最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

(python自制)還沒想好名字

2023-05-27 23:49 作者:未聞的夢(mèng)想  | 我要投稿


import pygame

import sys

import random

import csv

pygame.init()

clock = pygame.time.Clock ()

screen = pygame.display.set_mode((850,600))???

pygame.display.set_caption("mark")

xc,yc,sr=0,0,0

un=[0]

bjt=pygame.image.load("bjt.jpg")?

bjt1=pygame.image.load("bjt1.png")?

bjt2=pygame.image.load("bjt2.jpg")?

xuan=[]

pygame.mixer.init()

def qingli():

??global bushu,houtai,daibushu

??bushu=[[un],[un,un,un,un,un,un,un],[un,un,un,un,un,un,un],[un,un,un,un,un,un,un],[un,un,un,un,un,un,un],[un]]

??houtai=[[],[]]

??daibushu=[[["a1.jpg","奇妙魔方方",0,1,6,3,0,0,1,3,1,1],["a2.jpg","奇妙方魔魔",0,2,7,3,0,0,1,3,2,2]],[["a1.jpg","奇妙魔方方",1,1,6,3,0,0,1,3,1,1],["a2.jpg","奇妙方魔魔",1,2,7,3,0,0,1,3,2,2]]]

def dd():

??global houtai

??with open('f.csv','r',newline="") as f:

????reader = csv.reader(f)

????for row in reader:

???????houtai[0].insert(0,[])

???????houtai[1].insert(0,[])

???????for i in range(len(row)):

?????????if i>=2:

???????????row[i]=int(row[i])

?????????houtai[0][0].insert(100,row[i])

?????????houtai[1][0].insert(100,row[i])?????????

???????houtai[1][0][2]=1

????f.close

def hh():

??global sr,xc,yc,houtai,daibushu,bushu,xuan

??if xc>755 and xc<785 and yc>1065-505*sr and yc<1095-505*sr:

????if huihe[sr-1]<12:

??????huihe[sr-1]=huihe[sr-1]+1

????feiyong[sr-1]=huihe[sr-1]

????sr=3-sr

????for i in range(len(bushu)):

??????for j in range(len(bushu[i])):

????????if i>0 and i<5:

??????????if len(bushu[i][j])>9:

????????????if bushu[i][j][2]==sr-1:

??????????????bushu[i][j][10]=bushu[i][j][11]

????for i in range(2+int(huihe[sr-1]/6)):

??????if len(daibushu[sr-1])<9:???????

????????if len(houtai[sr-1])>=1:??

???????????sui=random.randint(0,len(houtai[sr-1])-1)

???????????daibushu[sr-1].append(houtai[sr-1][sui])

???????????houtai[sr-1].pop(sui)

??if xc>444 and xc<444+40*len(daibushu[sr-1]) and yc>1015-505*sr and yc<1055-505*sr:

?????shu=int((xc-444)/40)

?????xuan=[shu*40+444,1055-505*sr,40,5,0,0,0,0,daibushu[sr-1][shu]]

??elif xc>100 and xc<800 and yc>100 and yc<500:

????xa=int((xc-100)/100)

????ya=int((yc-100)/100)

????if xuan[2]==40 and len(bushu[ya+1][xa])==1 and ya==6-3*sr:

??????if daibushu[sr-1][int((xuan[0]-444)/40)][3]<=feiyong[sr-1]:

????????feiyong[sr-1]=feiyong[sr-1]-daibushu[sr-1][int((xuan[0]-444)/40)][3]

????????bushu[ya+1][xa]=daibushu[sr-1][int((xuan[0]-444)/40)]

????????daibushu[sr-1].pop(int((xuan[0]-444)/40))

????elif xuan[2]==96:

??????hen=xuan[6]-xa

??????if hen<0:

????????hen=-hen

??????zong=xuan[7]-ya-1

??????if zong<0:

????????zong=-zong

??????jian=0

??????for ib in range(3):

????????for jb in range(3):

??????????if ya+2-ib>0 and ya+2-ib<5 and xa+1-jb>=0 and xa+1-jb<=5:

????????????if len(bushu[ya+2-ib][xa+1-jb])>6:

??????????????if bushu[ya+2-ib][xa+1-jb][2]==2-sr:

????????????????jian=jian+1+bushu[ya+2-ib][xa+1-jb][6]

??????????????if bushu[ya+2-ib][xa+1-jb][2]==sr-1:

??????????????????????jian=jian-1

??????if jian<0:

????????jian=0

??????if len(bushu[ya+1][xa])>6 and bushu[ya+1][xa][2]==2-sr and hen+zong<=xuan[4]:???

????????bushu[ya+1][xa][4]=bushu[ya+1][xa][4]-bushu[xuan[7]][xuan[6]][5]

????????bushu[xuan[7]][xuan[6]][4]=bushu[xuan[7]][xuan[6]][4]-jian

????????if bushu[ya+1][xa][4]<=0:

??????????bushu[ya+1][xa]=[0]

????????bushu[xuan[7]][xuan[6]][10]=bushu[xuan[7]][xuan[6]][10]-1

????????if bushu[xuan[7]][xuan[6]][4]<=0:

??????????bushu[xuan[7]][xuan[6]]=[0]

????????xuan=[-10,-10,0,0]

??????elif len(bushu[ya+1][xa])==1 and hen+zong<=xuan[5]:

????????bushu[xuan[7]][xuan[6]][4]=bushu[xuan[7]][xuan[6]][4]-2**jian+1

????????bushu[ya+1][xa]=bushu[xuan[7]][xuan[6]]?

????????bushu[xuan[7]][xuan[6]]=[0]

????????bushu[ya+1][xa][10]=bushu[ya+1][xa][10]-1

????????if bushu[ya+1][xa][4]<=0:

??????????bushu[ya+1][xa]=[0]

????????xuan=[-10,-10,0,0]

????if len(bushu[ya+1][xa])>1 and bushu[ya+1][xa][2]==sr-1:

??????if bushu[ya+1][xa][10]>0:

????????xuan=[xa*100+102,ya*100+102,96,96,bushu[ya+1][xa][8],bushu[ya+1][xa][9],xa,ya+1,bushu[ya+1][xa]]

??????else:

????????xuan=[-10,-10,0,0]

??else:

????xuan=[-10,-10,0,0]


def jiagou():

??global sr,houtai,daibushu,bushu,feiyong,xuan

??pygame.draw.rect(screen,"yellow",(xuan[0],xuan[1],xuan[2],xuan[3]))

??if len(xuan)>8:

????s = pygame.Surface((220,80), pygame.SRCALPHA)

????if xuan[8][2]==sr-1:

??????s.fill((40,160,250,150))

????else:

??????s.fill((200,120,10,150))

????screen.blit(s, (100,510-505*(sr-1)))?

????fontn=pygame.font.match_font("Microsoft YaHei")

????font=pygame.font.Font(fontn,15)

????text1=font.render(str(xuan[8][1]),True,"white",None)

????ta=text1.get_rect()

????screen.blit(text1,(215-ta[2]/2,511-505*(sr-1),50,20))

????im=["卡牌生命:","卡牌攻擊:","最遠(yuǎn)射程:","最遠(yuǎn)移動(dòng):","當(dāng)前電量:","電池容量:"]

????jm=[4,5,8,9,10,11]

????for t in range(6):

??????text2=font.render(im[t]+str(xuan[8][jm[t]]),True,"white",None)

??????screen.blit(text2,(105+110*(t-int(t/2)*2),529-505*(sr-1)+18*int(t/2)))?????

??for i in range(feiyong[0]):

????pygame.draw.rect(screen,"palegreen",(444+20*i,560,16,30))

??for i in range(feiyong[1]):

????pygame.draw.rect(screen,"palegreen",(444+20*i,55,16,30))

??for i in range(len(daibushu)):

????for j in range(len(daibushu[i])):

??????dbsjg=pygame.image.load(daibushu[i][j][0])??

??????dbsjga=pygame.transform.scale(dbsjg,(40,40))

??????screen.blit(dbsjga,(444+40*j,510-505*i))

??????font=pygame.font.Font(None,30)

??????text1=font.render(" "+str(daibushu[i][j][3])+" ",True,"white","skyblue")

??????screen.blit(text1,(444+40*j,510-505*i,50,20))

??for i in range(len(bushu)):

???if i>0 and i<5:

????for j in range(len(bushu[i])):

?????if len(bushu[i][j])>6:

??????if bushu[i][j][2]==sr-1:

????????if bushu[i][j][10]>0:

??????????pygame.draw.rect(screen,"purple",(102+100*j,102+100*(i-1),96,96))

????????else:

??????????pygame.draw.rect(screen,"blue",(102+100*j,102+100*(i-1),96,96))

??????else:

????????if bushu[i][j][10]>0:

???????????pygame.draw.rect(screen,"red",(102+100*j,102+100*(i-1),96,96))

????????else:

??????????pygame.draw.rect(screen,"deeppink",(102+100*j,102+100*(i-1),96,96))

??????dbsjg=pygame.image.load(bushu[i][j][0])??

??????dbsjga=pygame.transform.scale(dbsjg,(90,90))

??????screen.blit(dbsjga,(105+100*j,105+100*(i-1)))

??????font=pygame.font.Font(None,24)

??????pygame.draw.rect(screen,"green3",(105+100*j,105+100*(i-1),40,15))

??????text1=font.render(str(bushu[i][j][4]),True,"white",None)

??????ta=text1.get_rect()

??????screen.blit(text1,(125+-ta[2]/2+100*j,105+100*(i-1),50,20))

??????pygame.draw.rect(screen,"pink",(105+100*j,120+100*(i-1),40,15))

??????text1=font.render(str(bushu[i][j][5]),True,"white",None)

??????ta=text1.get_rect()

??????screen.blit(text1,(125-ta[2]/2+100*j,120+100*(i-1),50,20))

??????pygame.draw.rect(screen,"deepskyblue",(105+100*j,135+100*(i-1),40,15))

??????text1=font.render(str(bushu[i][j][10])+" / "+str(bushu[i][j][11]),True,"white",None)

??????ta=text1.get_rect()

??????screen.blit(text1,(125-ta[2]/2+100*j,135+100*(i-1),50,20))

??if xuan[2]==96:

????xa,ya=xuan[6],xuan[7]

????for i in range(len(bushu)):

??????if i>0 and i<5:

????????for j in range(len(bushu[i])):

??????????hen=j-xa

??????????if hen<0:

????????????hen=-hen

??????????zong=i-ya

??????????if zong<0:

????????????zong=-zong

??????????if len(bushu[i][j])>6 and bushu[i][j][2]==2-sr and hen+zong<=xuan[4]:

????????????jian=0

????????????for ib in range(3):

??????????????for jb in range(3):

????????????????if i+1-ib>0 and i+1-ib<5 and j+1-jb>=0 and j+1-jb<=5:

??????????????????if len(bushu[i+1-ib][j+1-jb])>6:

????????????????????if bushu[i+1-ib][j+1-jb][2]==2-sr:

??????????????????????jian=jian+1+bushu[i+1-ib][j+1-jb][6]

????????????????????if bushu[i+1-ib][j+1-jb][2]==sr-1:

??????????????????????jian=jian-1

????????????if jian<0:

??????????????jian=0

????????????fontn=pygame.font.match_font("Microsoft YaHei")

????????????font=pygame.font.Font(fontn,30)

????????????text=font.render(str(jian),True,(20,20,20),None)

????????????screen.blit(text,(105+100*j,105+100*(i-1),100,20))

????????????s = pygame.Surface((90,90), pygame.SRCALPHA)??

????????????s.fill((20,20,200,150))?

????????????screen.blit(s, (105+100*j,105+100*(i-1)))?

??????????elif len(bushu[i][j])==1 and hen+zong<=xuan[5]:

????????????jian=0

????????????for ib in range(3):

??????????????for jb in range(3):

????????????????if i+1-ib>0 and i+1-ib<5 and j+1-jb>=0 and j+1-jb<=5:

??????????????????if len(bushu[i+1-ib][j+1-jb])>6:

????????????????????if bushu[i+1-ib][j+1-jb][2]==2-sr:

??????????????????????jian=jian+1+bushu[i+1-ib][j+1-jb][6]

????????????????????if bushu[i+1-ib][j+1-jb][2]==sr-1:

??????????????????????jian=jian-1

????????????if jian<0:

??????????????jian=0

????????????fontn=pygame.font.match_font("Microsoft YaHei")

????????????font=pygame.font.Font(fontn,30)

????????????text=font.render(str(2**jian-1),True,(20,20,20),None)

????????????screen.blit(text,(105+100*j,105+100*(i-1),100,20))

????????????s = pygame.Surface((90,90), pygame.SRCALPHA)??

????????????s.fill((20,200,200,150))?

????????????screen.blit(s, (105+100*j,105+100*(i-1)))?

def run():

??global xc,yc,kaishi,sr,houtai,daibushu,bushu,huihe,feiyong,bjt,bjt1,bjt2,xuan,chengbao

??kaishi=0

??fontn=pygame.font.match_font("Microsoft YaHei")

??font=pygame.font.Font(fontn,30)

??while 1:?

????clock.tick (100)?

????screen.fill((245,245,245))

????js=pygame.transform.scale(bjt1,(850,600))

????screen.blit(js,(0,0))

????if kaishi<1:

?????text=font.render("開始一場(chǎng)對(duì)局",True,(70,70,70),(210,240,240))

?????screen.blit(text,(310,260,100,20))

?????for event in pygame.event.get():

???????if event.type == pygame.QUIT:

????????pygame.quit()

????????sys.exit()

???????if event.type == pygame.MOUSEBUTTONDOWN:

??????????xc,yc= event.pos

??????????if xc>310 and xc<490 and yc>260 and yc<305:

????????????dd()

????????????xuan=[-10,-10,0,0]

????????????kaishi=1

????????????sr=1

????????????huihe=[1,1]

????????????feiyong=[1,2]

????????????chengbao=[["cb.jpg","必須守護(hù)的東西#",1,0,100,2,0,0,1,0,1,1],["cb.jpg","必須守護(hù)的東西#",0,0,100,2,0,0,1,0,1,1]]

????????????bushu[1][3]=chengbao[0]

????????????bushu[4][3]=chengbao[1]

????elif kaishi>=1:

??????pygame.draw.rect(screen,"purple",(350,510-505*(sr-1),80,80))

??????pygame.draw.rect(screen,"red",(350,510-505*(2-sr),80,80))

??????bp=pygame.transform.scale(bjt2,(700,400))

??????screen.blit(bp,(100,100))

??????jieshou2=pygame.image.load("a2.jpg")??

??????js2=pygame.transform.scale(jieshou2,(30,30))??

??????screen.blit(js2,(755,60))

??????screen.blit(js2,(755,560))

??????jieshou3=pygame.image.load("fanhui.jpg")??

??????js3=pygame.transform.scale(jieshou3,(20,20))

??????screen.blit(js3,(5,200))

??????for i in range(5):

????????pygame.draw.rect(screen,"skyblue",(98,98+100*i,700,5))

??????for i in range(8):

????????pygame.draw.rect(screen,"skyblue",(98+100*i,98,5,405))

??????for event in pygame.event.get():

????????if event.type == pygame.QUIT:

??????????pygame.quit()

??????????sys.exit()

????????if event.type == pygame.MOUSEBUTTONDOWN and kaishi==1:

??????????xc,yc= event.pos

??????????hh()

??????????if xc>5 and xc<25 and yc>200 and yc<220:

?????????????kaishi=0

?????????????qingli()

??????jiagou()

??????if chengbao[0][4]<=0 or chengbao[1][4]<=0:

????????jieshou4=pygame.image.load("pg.jpg")

????????js4=pygame.transform.scale(jieshou4,(80,80))?

????????if chengbao[0][4]<=0:

??????????screen.blit(js4,(350,5))

????????else:

??????????screen.blit(js4,(350,510))

????????if kaishi==1:

??????????music1 = pygame.mixer.Sound(r'pgyy1.wav')

??????????music1.play ()

????????kaishi=kaishi+1

????????if kaishi>500:

??????????kaishi=0

????????qingli()

????pygame.display.update()

qingli()

run()

(python自制)還沒想好名字的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
延津县| 武陟县| 义乌市| 赤壁市| 新安县| 普安县| 临汾市| 车致| 镇平县| 胶州市| 开原市| 温宿县| 安平县| 故城县| 扎兰屯市| 若羌县| 威远县| 余江县| 吕梁市| 梁平县| 陇南市| 芮城县| 庄浪县| 南和县| 塔河县| 南郑县| 昔阳县| 江达县| 瑞金市| 富裕县| 广宗县| 南昌市| 车险| 贵定县| 安吉县| 德惠市| 西宁市| 合山市| 台前县| 夏河县| 碌曲县|