qq连连看python源码(python连连看源代码)
本文目录一览:
- 1、连连看游戏Python图片怎么调
- 2、QQ连连看
- 3、求“连连看”flash在线小游戏的源代码
- 4、帮忙用python写下记忆游戏和连连看的游戏程序!万分感谢!
- 5、请用PYTHON编一个小游戏,如五子棋,连连看,贪吃蛇,扫雷,计算器等等
- 6、按键精灵 玩QQ连连看脚
连连看游戏Python图片怎么调
python有一个图像处理库——PIL,可以处理图像文件。
连连看小游戏是一款以连连看为主要元素的Flash游戏,只要将相同的两张牌用三根以内的直线连在一起就可以消除,操作方便,绿色,无需安装,简单容易上手。
PIL是python的一个图像处理库,功能非常强大,可以实现图片的格式转换、旋转、裁剪、改变尺寸、像素处理、图片合并等等操作。
QQ连连看
没有更新了,现在太多人用挂,就算知道又能怎么样,T了一个又有一个,烦啊
求“连连看”flash在线小游戏的源代码
把你的邮箱留下 我给你源文件 我这没有falsh软件 打不开 给你源文件
绝对使你满意 有四个不同的 flash 源文件 打开即可看到AS代码
帮忙用python写下记忆游戏和连连看的游戏程序!万分感谢!
真要有一万分,可以考虑亲自动手给你写。其实找个网上的类似的游戏的源代码,然后自己动手用python调用一下里面的一些函数就好了。自己写的话太麻烦,又不能卖,何必呢?
请用PYTHON编一个小游戏,如五子棋,连连看,贪吃蛇,扫雷,计算器等等
#!/usr/bin/python
from Tkinter import *
import random
class snake(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.body = [(0,0)]
self.bodyid = []
self.food = [ -1, -1 ]
self.foodid = -1
self.gridcount = 10
self.size = 500
self.di = 3
self.speed = 500
self.top = self.winfo_toplevel()
self.top.resizable(False, False)
self.grid()
self.canvas = Canvas(self)
self.canvas.grid()
self.canvas.config(width=self.size, height=self.size,relief=RIDGE)
self.drawgrid()
s = self.size/self.gridcount
id = self.canvas.create_rectangle(self.body[0][0]*s,self.body[0][1]*s,
(self.body[0][0]+1)*s, (self.body[0][1]+1)*s, fill="yellow")
self.bodyid.insert(0, id)
self.bind_all("KeyRelease", self.keyrelease)
self.drawfood()
self.after(self.speed, self.drawsnake)
def drawgrid(self):
s = self.size/self.gridcount
for i in range(0, self.gridcount+1):
self.canvas.create_line(i*s, 0, i*s, self.size)
self.canvas.create_line(0, i*s, self.size, i*s)
def drawsnake(self):
s = self.size/self.gridcount
head = self.body[0]
new = [head[0], head[1]]
if self.di == 1:
new[1] = (head[1]-1) % self.gridcount
elif self.di == 2:
new[0] = (head[0]+1) % self.gridcount
elif self.di == 3:
new[1] = (head[1]+1) % self.gridcount
else:
new[0] = (head[0]-1) % self.gridcount
next = ( new[0], new[1] )
if next in self.body:
exit()
elif next == (self.food[0], self.food[1]):
self.body.insert(0, next)
self.bodyid.insert(0, self.foodid)
self.drawfood()
else:
tail = self.body.pop()
id = self.bodyid.pop()
self.canvas.move(id, (next[0]-tail[0])*s, (next[1]-tail[1])*s)
self.body.insert(0, next)
self.bodyid.insert(0, id)
self.after(self.speed, self.drawsnake)
def drawfood(self):
s = self.size/self.gridcount
x = random.randrange(0, self.gridcount)
y = random.randrange(0, self.gridcount)
while (x, y) in self.body:
x = random.randrange(0, self.gridcount)
y = random.randrange(0, self.gridcount)
id = self.canvas.create_rectangle(x*s,y*s, (x+1)*s, (y+1)*s, fill="yellow")
self.food[0] = x
self.food[1] = y
self.foodid = id
def keyrelease(self, event):
if event.keysym == "Up" and self.di != 3:
self.di = 1
elif event.keysym == "Right" and self.di !=4:
self.di = 2
elif event.keysym == "Down" and self.di != 1:
self.di = 3
elif event.keysym == "Left" and self.di != 2:
self.di = 4
app = snake()
app.master.title("Greedy Snake")
app.mainloop()
贪食蛇
按键精灵 玩QQ连连看脚
Dim se(19, 11)
UserVar llk=0 "消除时间"
e = Plugin.Window.Find(0, "QQ游戏 - 连连看角色版")
f = Plugin.window.Foreground()
g = Plugin.Sys.GetScRX()
h = Plugin.Sys.GetScRY()
If e 0 Then
If f = e Then
i = Plugin.Window.GetWindowRect(e)
j = Split(i, "|")
k = Int(j(0))
l = Int(j(1))
bj="无"
If k = 0 and l = 0 and k + 799 = g and y + 599 = h Then
rect=GetPixelColor(664+k,96+l)
IfColor k + 64, l + 80, rect, 1 Then
k = k + 28
l = l + 195
m = 0
n = 1
For a = 0 To 18
For b = 0 To 10
se(a, b) = bj
IfColor a * 31 - 12 + k, b * 35 - 13 + l, rect, 0 Then
se(a, b) = GetPixelColor(a * 31 + k, b * 35 + l)
m = m + 1
End If
Next
Next
While m 0 and n m
n = m
For a = 0 To 18
For b = 0 To 10
If se(a, b) bj Then
d=b+1
For c = a To 18
While d = 10
If se(a, b) = se(c, d) Then
If a = c Then
y1 = b + 1
While se(a, y1) = bj
y1=y1+1
Wend
If y1 = d Then
Call 消除():b=d
Exit For
Else
y2=1
While se(a + y2, b) = bj and se(c + y2, d) = bj
y1 = b + 1
While se(a+y2, y1) = bj
y1=y1+1
Wend
If y1 = d Then
Call 消除():b=d
Exit For
End If
y2=y2+1
Wend
y2=1
While se(a - y2, b) = bj and se(c - y2, d) = bj
y1 = b + 1
While se(a-y2, y1) = bj
y1=y1+1
Wend
If y1 = d Then
Call 消除():b=d
Exit For
End If
y2=y2+1
Wend
End If
ElseIf b = d Then
x1 = a + 1
While se(x1, b) = bj
x1=x1+1
Wend
If x1 = c Then
Call 消除()
Exit For
Else
x2=1
While se(a, b + x2) = bj and se(c, d + x2) = bj
x1 = a + 1
While se(x1, b+x2) = bj
x1=x1+1
Wend
If x1 = c Then
Call 消除()
Exit For
End If
x2=x2+1
Wend
x2=1
While se(a, b - x2) = bj and se(c, d - x2) = bj
x1 = a + 1
While se(x1, b-x2) = bj
x1=x1+1
Wend
If x1 = c Then
Call 消除()
Exit For
End If
x2=x2+1
Wend
End If
Else
left2=c:down1=b:up1=b
While se(a,down1-1)=bj
down1=down1-1
Wend
While se(a, up1 + 1) = bj
up1=up1+1
Wend
While se(left2 - 1, d) = bj
left2=left2-1
Wend
If down1=d and up1=d and left2=a Then
Call 消除():b=up1
Exit For
End If
right1=a:down2=d:up2=d
While se(right1+1, b) = bj
right1=right1+1
Wend
While se(c, down2 - 1) = bj
down2=down2-1
Wend
While se(c, up2 + 1) = bj
up2=up2+1
Wend
If up2 = b and down2 = b and right1 = c Then
Call 消除():b=up1
Exit For
End If
left1=a:right2=c:bigy=d:smally=b
While se(left1 - 1, b) = bj
left1=left1-1
Wend
While se(right2 + 1, d) = bj
right2=right2+1
Wend
If b d Then
bigy=b
smally=d
End If
If left1 left2 Then
leftz=left2
Else
leftz=left1
End If
If right1 right2 Then
lefty=right1
Else
lefty=right2
End If
w=0
While wlefty-leftz+1
y1=smally
While se(leftz+w,y1+1)=bj
y1=y1+1
Wend
If y1 = bigy Then
Call 消除():b=up1
Exit For
End If
w=w+1
Wend
If down1 down2 Then
leftx=down2
Else
leftx=down1
End If
If up1 up2 Then
leftw=up1
Else
leftw=up2
End If
w=0
While wleftw-leftx+1
x1=a
While se(x1+1,leftx+w)=bj
x1=x1+1
Wend
If x1 = c Then
Call 消除():b=up1
Exit For
End If
w=w+1
Wend
d=up2
End If
End If
d=d+1
Wend
d=0
Next
End If
Next
Next
Wend
LeftUp 1
End If
End If
End If
End If
Sub 消除()
MoveTo a * 31 + k, b * 35 + l
LeftDown 1
Delay llk
MoveTo c * 31 + k, d * 35 + l
LeftDown 1
se(a, b) = bj
se(c, d) = bj
m = m - 2
End Sub