当前位置: 首页>>代码示例>>Python>>正文


Python Tile.init方法代码示例

本文整理汇总了Python中tile.Tile.init方法的典型用法代码示例。如果您正苦于以下问题:Python Tile.init方法的具体用法?Python Tile.init怎么用?Python Tile.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tile.Tile的用法示例。


在下文中一共展示了Tile.init方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self,voice=1):
		if voice==1: super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME : 0:00"
		self.timechange = False
		self.movechange = False
		self.mute = -1
		self.mode = "play"
		#self.mode = "solve"
		self.solvelist = [5,6,7,3,2,6,5,1,2,3,7]
		self.solvelist += [11,12,8,4,3,7,6,10,9]
		self.solvelist += [13,14,15,16,12,11,10,9,13,14,15,11]
		self.solvelist += [10,14,13,9,10,6,5,9,13,14,15]
		self.solveindex = len(self.solvelist)-1

		datastring = "1000\n"
		datastring += "1000\n"
		writeFile("game4data.txt",datastring)

		global curk,k
		curk,k = 16,16
		global pg,pp
		pg = [2,7,10,11,14]
		pp = [1,3,4,5,9,13]
		
		Gear.init()
		Tile.init()
		Pipe.init()

		self.win = False
		self.gears = pygame.sprite.Group()
		self.pipes = pygame.sprite.Group()

		self.gears.add(Gear(330-65,180+65,-1,0))
		self.gears.add(Gear(330+65*4,180,17,0,1))

		self.tiles = pygame.sprite.Group()

		for i in range(4):
			for j in range(4):
				x=330+65*j
				y=180+65*i
				num=j*4+i+1
				if num != curk: self.tiles.add(Tile(x,y,num))
				if num in pg: 
					self.gears.add(Gear(x,y,num,0))
				if num in pp:
					if num == 13:
						self.pipes.add(Pipe(x,y,num,4))
					elif num == 5:
						self.pipes.add(Pipe(x,y,num,5))
					else:
						self.pipes.add(Pipe(x,y,num,1))

		self.exit = 20
		self.exittype = 1
		self.timer = 15
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:62,代码来源:game4.py

示例2: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self):
		super().init()
		self.bgColor = (255,255,255)
		self.count = 15
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME : 0:00"
		self.moveup = False
		self.mute = -1

		global curk,k
		curk,k = 3,3
		global p
		p = [1,4,6,7,10,11,13,16]
		
		Gear.init()
		Tile.init()
		self.win = False
		self.gears = pygame.sprite.Group()
		self.gears.add(Gear(330,180+65*4,-1,1))
		self.gears.add(Gear(330+65*4,180,17,0))
		self.tiles = pygame.sprite.Group()

		for i in range(4):
			for j in range(4):
				x=330+65*j
				y=180+65*i
				num=j*4+i+1
				if num != curk: self.tiles.add(Tile(x,y,num))
				if num in p: 
					if num==4: 
						self.gears.add(Gear(x,y,num,1))	
					else:
						self.gears.add(Gear(x,y,num,0))
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:36,代码来源:game1move.py

示例3: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self,voice=1):
		if voice==1: super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME : 0:00"
		self.timechange = False
		self.movechange = False
		self.mute = -1
		self.mode = "play"
		#self.mode = "solve"
		self.solvelist = [11,10,9,13,14,10,11,7,6,10,11,12,8]
		self.solvelist += [7,3,2,6,10,11,12,8,7,3]
		self.solveindex = len(self.solvelist)-1

		datastring = "1000\n"
		datastring += "1000\n"
		writeFile("game5data.txt",datastring)

		global curk,k
		curk,k = 4,4
		global p3,p6
		p3 = [1,2,3,5,6,9]
		p6 = [8,11,12,14,15,16]
		
		Pipe.init()
		Tile.init()
		Gear.init()

		self.win = False
		self.pipes = pygame.sprite.Group()
		self.tiles = pygame.sprite.Group()
		self.gears = pygame.sprite.Group()

		self.gears.add(Gear(330+65*3+5,180-55,-1,0,1))
		
		for i in range(4):
			for j in range(4):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p3:
					self.pipes.add(Pipe(x,y,num,3))
				elif num in p6:
					self.pipes.add(Pipe(x,y,num,6))
				elif num!= curk:
					self.tiles.add(Tile(x,y,num))

		self.exit = 0
		self.exittype = 6
		self.timer = 15
		self.gassound = pygame.mixer.Sound('sound/gas01.wav')
		self.gassound.play()
		self.gassound.set_volume(0.2)
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:57,代码来源:game5.py

示例4: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self):
		super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 3100
		self.min = 0
		self.timetext = "TIME : 0:30"
		self.timeup = False
		self.mute = -1

		global curk,k
		curk,k = 4,4
		global p1,p2,p3,p4,p5,p6,p7
		p1 = [5,7,10,12,15]
		p2 = [8,9]
		p3 = [14]
		p4 = []
		p5 = [3]
		p6 = [2]
		p7 = [6,11]
		
		Pipe.init()
		Tile.init()
		Gear.init()

		self.win = False
		self.pipes = pygame.sprite.Group()
		self.tiles = pygame.sprite.Group()
		self.gears = pygame.sprite.Group()

		self.gears.add(Gear(330+65*3+5,180-55,-1,0))

		for i in range(4):
			for j in range(4):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p1: 
					self.pipes.add(Pipe(x,y,num,1))	
				elif num in p2:
					self.pipes.add(Pipe(x,y,num,2))
				elif num in p3:
					self.pipes.add(Pipe(x,y,num,3))
				elif num in p4:
					self.pipes.add(Pipe(x,y,num,4))
				elif num in p5:
					self.pipes.add(Pipe(x,y,num,5))
				elif num in p6:
					self.pipes.add(Pipe(x,y,num,6))
				elif num in p7:
					self.pipes.add(Pipe(x,y,num,7))
				elif num!= curk:
					self.tiles.add(Tile(x,y,num))

		self.timer = 15
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:57,代码来源:game7timing.py

示例5: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self):
		super().init()
		self.bgColor = (255,255,255)
		self.count = 50
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME : 0:00"
		self.moveup = False
		self.mute = -1

		global curk,k
		curk,k = 16,16
		global pg,pp
		pg = [2,7,10,11,14]
		pp = [1,3,4,5,9,13]
		
		Gear.init()
		Tile.init()
		Pipe.init()

		self.win = False
		self.gears = pygame.sprite.Group()
		self.pipes = pygame.sprite.Group()

		self.gears.add(Gear(330-65,180+65,-1,0))
		self.gears.add(Gear(330+65*4,180,17,0))

		self.tiles = pygame.sprite.Group()

		for i in range(4):
			for j in range(4):
				x=330+65*j
				y=180+65*i
				num=j*4+i+1
				if num != curk: self.tiles.add(Tile(x,y,num))
				if num in pg: 
					self.gears.add(Gear(x,y,num,0))
				if num in pp:
					if num == 13:
						self.pipes.add(Pipe(x,y,num,4))
					elif num == 5:
						self.pipes.add(Pipe(x,y,num,5))
					else:
						self.pipes.add(Pipe(x,y,num,1))

		self.exit = 20
		self.exittype = 1
		self.timer = 15
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:50,代码来源:game4move.py

示例6: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self):
		super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 2100
		self.min = 0
		self.timetext = "TIME: 0:20"
		self.timeup = False
		self.mute = -1

		global curk,k
		curk,k = 3,3
		global p1,p2,p3
		p1 = [5,8,9,12]
		p2 = [2,14,15]
		p3 = [13]
		
		Pipe.init()
		Tile.init()
		Gear.init()

		self.win = False
		self.pipes = pygame.sprite.Group()
		self.tiles = pygame.sprite.Group()
		self.gears = pygame.sprite.Group()

		self.gears.add(Gear(330+65*3+5,180-55,-1,0))

		for i in range(4):
			for j in range(4):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p1: 
					self.pipes.add(Pipe(x,y,num,1))	
				elif num in p2:
					self.pipes.add(Pipe(x,y,num,2))
				elif num in p3:
					self.pipes.add(Pipe(x,y,num,3))
				elif num!= curk:
					self.tiles.add(Tile(x,y,num))
		self.exit = 0
		self.exittype = 1
		self.timer = 15
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:46,代码来源:game2timing.py

示例7: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self,voice=1):
		if voice==1: super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME : 0:00"
		self.timechange = False
		self.movechange = False
		self.mute = -1
		self.mode = "play"
		#self.mode = "solve"
		self.solvelist = [12,11,15,16,12,11,10,9,5,6,7]
		self.solveindex = len(self.solvelist)-1

		global curk,k
		curk,k = 3,3
		global p
		p = [1,4,6,7,10,11,13,16]

		datastring = "1000\n"
		datastring += "1000\n"
		writeFile("game1data.txt",datastring)

		Gear.init()
		Tile.init()
		self.win = False
		self.gears = pygame.sprite.Group()
		self.gears.add(Gear(330,180+65*4,-1,1))
		self.gears.add(Gear(330+65*4,180,17,0,1))
		self.tiles = pygame.sprite.Group()

		for i in range(4):
			for j in range(4):
				x=330+65*j
				y=180+65*i
				num=j*4+i+1
				if num != curk: self.tiles.add(Tile(x,y,num))
				if num in p: 
					if num==4: 
						self.gears.add(Gear(x,y,num,1))	
					else:
						self.gears.add(Gear(x,y,num,0))
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:45,代码来源:game1.py

示例8: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self):
		super().init()
		self.bgColor = (255,255,255)
		self.count = 30
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME : 0:00"
		self.moveup = False
		self.mute = -1

		global curk,k
		curk,k = 4,4
		global p3,p6
		p3 = [1,2,3,5,6,9]
		p6 = [8,11,12,14,15,16]
		
		Pipe.init()
		Tile.init()
		Gear.init()

		self.win = False
		self.pipes = pygame.sprite.Group()
		self.tiles = pygame.sprite.Group()
		self.gears = pygame.sprite.Group()

		self.gears.add(Gear(330+65*3+5,180-55,-1,0))
		
		for i in range(4):
			for j in range(4):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p3:
					self.pipes.add(Pipe(x,y,num,3))
				elif num in p6:
					self.pipes.add(Pipe(x,y,num,6))
				elif num!= curk:
					self.tiles.add(Tile(x,y,num))

		self.exit = 0
		self.exittype = 6
		self.timer = 15
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:44,代码来源:game5move.py

示例9: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self):
		super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 1000 
		self.min = 0
		self.timetext = "TIME : 0:10"
		self.timeup = False
		self.mute = -1

		global curk,k
		curk = random.randint(1,16)
		k = curk
		global p
		p=[]
		while len(p)<7:
			a = random.randint(1,16)
			if a!=k and not a in p: 
				p += [a]
		
		Gear.init()
		Tile.init()
		self.win = False
		self.gears = pygame.sprite.Group()
		self.gears.add(Gear(330,180+65*4,-1,1))
		self.gears.add(Gear(330+65*4,180,17,0))
		self.tiles = pygame.sprite.Group()

		for i in range(4):
			for j in range(4):
				x=330+65*j
				y=180+65*i
				num=j*4+i+1
				if num != curk: self.tiles.add(Tile(x,y,num))
				if num in p: 
					if num==4: 
						self.gears.add(Gear(x,y,num,1))	
					else:
						self.gears.add(Gear(x,y,num,0))
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:41,代码来源:game1timing.py

示例10: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self,voice=1):
		if voice==1: super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME: 0:00"
		self.timechange = False
		self.movechange = False
		self.mute = -1
		self.mode = "play"
		#self.mode = "solve"
		self.solvelist = [10,6,7,3,2,1,5,9]
		self.solvelist += [10,6,5,9,10,6,2,3]
		self.solvelist += [4,8,12,11,7,8]
		self.solvelist += [12,11,10,6,2,3]
		self.solvelist += [7,8,4,3,7,8,12,11,10]
		self.solvelist += [6,7,8,12,11,10,9,5,6,7]
		self.solveindex = len(self.solvelist)-1

		datastring = "1000\n"
		datastring += "1000\n"
		writeFile("game6data.txt",datastring)

		global curk,k
		curk,k = 8,8
		global p1,p2,p3,p4,p5,p6
		p1 = []
		p2 = [1,6,9]
		p3 = [4]
		p4 = [3]
		p5 = [10]
		p6 = [5]
		
		Pipe.init()
		Tile.init()

		self.win = False
		self.pipes = pygame.sprite.Group()
		self.tiles = pygame.sprite.Group()

		for i in range(4):
			for j in range(3):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p1: 
					self.pipes.add(Pipe(x,y,num,1))	
				elif num in p2:
					self.pipes.add(Pipe(x,y,num,2))
				elif num in p3:
					self.pipes.add(Pipe(x,y,num,3))
				elif num in p4:
					self.pipes.add(Pipe(x,y,num,4))
				elif num in p5:
					self.pipes.add(Pipe(x,y,num,5))
				elif num in p6:
					self.pipes.add(Pipe(x,y,num,6))
				elif num!= curk:
					self.tiles.add(Tile(x,y,num))

		self.exit = 8
		self.exittype = "init"
		self.timer = 15
		self.gassound = pygame.mixer.Sound('sound/gas01.wav')
		self.gassound.play()
		self.gassound.set_volume(0.2)
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:69,代码来源:game6.py

示例11: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self,voice=1):
		if voice==1: super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 0 
		self.flysec = 0
		self.min = 0
		self.timetext = "TIME: 0:00"
		self.timechange = False
		self.movechange = False
		self.mute = -1
		self.mode = "play"
		#self.mode = "solve"
		self.solvelist = [7,8,4,3,7,11,15,14,10,11,7,6,5]
		self.solvelist += [9,13,14,10,9,5,6,10,9,5,1]
		self.solvelist += [2,6,10,11,15,14,10,6]
		self.solvelist += [7,11,15,16,12,11,10,14,15,16,12,11]
		self.solveindex = len(self.solvelist)-1

		datastring = "1000\n"
		datastring += "1000\n"
		writeFile("game8data.txt",datastring)

		global curk1,curk2
		curk1,curk2 = 7,11
		global p1,p2
		p1 = [2,3,5,8,9,12,14,15]
		p2 = [2,4,7,14]
		self.flip = 1
		
		Pipe.init()
		Tile.init()
		Gear.init()

		self.win = False
		self.pipes = pygame.sprite.Group()
		self.backpipes = pygame.sprite.Group()
		self.tiles = pygame.sprite.Group()
		self.backtiles = pygame.sprite.Group()
		self.gears = pygame.sprite.Group()

		self.gears.add(Gear(265,118,-1,0,1))

		for i in range(4):
			for j in range(4):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p1: 
					self.pipes.add(Pipe(x,y,num,1))	
				elif num!= curk1:
					self.tiles.add(Tile(x,y,num))

		for i in range(4):
			for j in range(4):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p2: 
					self.backpipes.add(Pipe(x,y,num,2))	
				elif num!= curk2:
					self.backtiles.add(Tile(x,y,num))

		self.exit1 = 0
		self.exittype1 = "left"
		self.exit2 = 0
		self.exittype2 = "none"
		self.timer = 15
		self.gassound = pygame.mixer.Sound('sound/gas01.wav')
		self.gassound.play()
		self.gassound.set_volume(0.2)
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:73,代码来源:game8.py

示例12: init

# 需要导入模块: from tile import Tile [as 别名]
# 或者: from tile.Tile import init [as 别名]
	def init(self,voice=1):
		if voice==1: super().init()
		self.bgColor = (255,255,255)
		self.count = 0
		self.sec = 0 
		self.min = 0
		self.timetext = "TIME : 0:00"
		self.timechange = False
		self.movechange = False
		self.mute = -1
		self.mode = "play"
		#self.mode = "solve"
		self.solvelist = [2,6,7,8,4,3,2,6,5,1,2,6]
		self.solvelist += [10,9,13,14,10,9,5,6,10]
		self.solvelist += [9,13,14,15,11,10,9,13,14,15,16]
		self.solvelist += [12,11,10,9,13,14,15,16,12,8]
		self.solveindex = len(self.solvelist)-1

		datastring = "1000\n"
		datastring += "1000\n"
		writeFile("game7data.txt",datastring)

		global curk,k
		curk,k = 4,4
		global p1,p2,p3,p4,p5,p6,p7
		p1 = [5,7,10,12,15]
		p2 = [8,9]
		p3 = [14]
		p4 = []
		p5 = [3]
		p6 = [2]
		p7 = [6,11]
		
		Pipe.init()
		Tile.init()
		Gear.init()

		self.win = False
		self.pipes = pygame.sprite.Group()
		self.tiles = pygame.sprite.Group()
		self.gears = pygame.sprite.Group()

		self.gears.add(Gear(330+65*3+5,180-55,-1,0,1))

		for i in range(4):
			for j in range(4):
				x=332+65*j
				y=180+65*i
				num = j*4+i+1
				if num in p1: 
					self.pipes.add(Pipe(x,y,num,1))	
				elif num in p2:
					self.pipes.add(Pipe(x,y,num,2))
				elif num in p3:
					self.pipes.add(Pipe(x,y,num,3))
				elif num in p4:
					self.pipes.add(Pipe(x,y,num,4))
				elif num in p5:
					self.pipes.add(Pipe(x,y,num,5))
				elif num in p6:
					self.pipes.add(Pipe(x,y,num,6))
				elif num in p7:
					self.pipes.add(Pipe(x,y,num,7))
				elif num!= curk:
					self.tiles.add(Tile(x,y,num))
		self.timer = 15
		self.gassound = pygame.mixer.Sound('sound/gas01.wav')
		self.gassound.play()
		self.gassound.set_volume(0.2)
开发者ID:igobble,项目名称:Fantastic-Gears,代码行数:71,代码来源:game7.py


注:本文中的tile.Tile.init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。