本文整理汇总了Python中Img.img2方法的典型用法代码示例。如果您正苦于以下问题:Python Img.img2方法的具体用法?Python Img.img2怎么用?Python Img.img2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Img
的用法示例。
在下文中一共展示了Img.img2方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import Img [as 别名]
# 或者: from Img import img2 [as 别名]
__author__ = 'NoNotCar'
import pygame, sys
pygame.init()
screen = pygame.display.set_mode((640, 704))
import World
import Tiles
import Img
clock = pygame.time.Clock()
selmenu=0
selobjs=[0 for _ in Tiles.tilemenus+Tiles.objmenus]
w=World.World(True)
expimg=Img.img2("Exp")
pexpimg=Img.img2("ExpPen")
bombimg=Img.img2("Bomb")
while True:
kmods=pygame.key.get_mods()
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
elif event.type==pygame.KEYDOWN and event.key==pygame.K_s and kmods&pygame.KMOD_LCTRL:
w.save()
print "SAVED"
elif event.type==pygame.KEYDOWN:
menus=Tiles.tilemenus+Tiles.objmenus
menu=menus[selmenu]
if event.key==pygame.K_w:
selobjs[selmenu]=(selobjs[selmenu]-1)%len(menu)
elif event.key==pygame.K_s:
selobjs[selmenu]=(selobjs[selmenu]+1)%len(menu)
elif event.key==pygame.K_a:
示例2: World
# 需要导入模块: import Img [as 别名]
# 或者: from Img import img2 [as 别名]
import Img
class World(object):
def __init__(self, txt, mus, back, load):
self.textures = txt
self.music = mus
self.back = back
self.loadcolour = load
worlds = [World([Img.img2("Grass"), Img.img2("Block"), Img.img2("Grass2")], "forbidden", (125, 255, 255), (125, 225, 0)),
World([Img.img2("Snow"), Img.img2("CastleBlock"), Img.img2("FrozenIn")], "Chr", (240, 240, 240),
(255, 255, 255)),
World([Img.img2("Spacefloor"), Img.img2("CastleBlock"), Img.img2("CastleIn")], "Space", (0, 0, 0),
(50, 50, 50)),
World([Img.img2("Sand"), Img.img2("Block"), Img.img2("CastleInGrey"), Img.img2("Oil")], "Desert",
(181, 117, 0), (250, 250, 0)),
World([Img.img2("Spacefloor"), Img.img2("PuzzBlockDest"), Img.img2("PuzzBlock"),Img.img2("IceSpace")], "ChOrDs", (255, 255, 255),
(255, 255, 255)),
World([Img.img2("RockSnow"), Img.img2("RedBlock"), Img.img2("CastleIn"), Img.img2("RockIce")], "Volcanic",
(255, 93, 0), (200, 59, 0)),
World([Img.img2("PinkGround"), Img.img2("PinkBlock"), Img.img2("Pink2"), Img.img2("PinkIce")], "DOMINIK_4", (255, 186, 245),
(255, 81, 226)),
World([Img.img2("RedGrass"), Img.img2("RedBlock"), Img.img2("CastleIn"), Img.img2("RockIce")], "Devil",
(84, 2, 0), (133, 5, 1))]
castle = World([Img.img2("CastleFloor"), Img.img2("CastleBlock"), Img.img2("CastleIn")], "boss", (125, 125, 125),
(200, 200, 200))
final1=World([Img.img2("Grass"), Img.img2("Flowers"), Img.img2("Tree")], "forbidden", (125, 255, 255), (125, 225, 0))
final2=World([Img.img2("EndFloor"), Img.img2("EndBrick"), Img.img2("EndBlock")], "boss", (0, 0, 0),
(50, 50, 50))
示例3:
# 需要导入模块: import Img [as 别名]
# 或者: from Img import img2 [as 别名]
__author__ = 'NoNotCar'
import pygame, sys, os
pygame.init()
pygame.font.init()
screen = pygame.display.set_mode((640, 704))
import BattleWorld, Img
from random import choice
import Controllers
pdf = pygame.font.get_default_font()
tfont=pygame.font.Font(pdf,60)
sfont=pygame.font.Font(pdf,20)
clock = pygame.time.Clock()
expimg=Img.img2("Exp")
pexpimg=Img.img2("ExpPen")
bombimg=Img.img2("Bomb")
tickimg=Img.img2("Tick")
crossimg=Img.img2("Null")
pimgs=[Img.img2("men/"+x) for x in ["Man2","FMan","SMan","Tman"]]#+[Img.imgstrip("men/CMan")[0]]
breaking = False
Img.musplay("ChOrDs.ogg")
while not breaking:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
elif event.type == pygame.MOUSEBUTTONDOWN:
breaking = True
screen.fill((255, 0, 0))
Img.bcentre(tfont,"BOMB BATTLES",screen)
Img.bcentre(sfont,"Click to start",screen,50)
pygame.display.flip()
示例4: Grass
# 需要导入模块: import Img [as 别名]
# 或者: from Img import img2 [as 别名]
Grass(),
Goal(),
Ice(),
SokoHole(),
SokoHoleFilled(),
SokoPlate(),
SokoPlateAct(),
BonusGoal(),
WarpGoal(),
ManPlate(),
ManPlateAct(),
DarkMatter(),
)
eobjs = (
(
(Img.img2("Block"), 1),
(Img.imgstrip("Ghost")[0], 0),
(Img.img2("Men/Man2"), 0),
(Img.imgstrip2("Thud")[0], 0),
(Img.img32("RangeUp"), 0),
(Img.img2("Grass2"), 1),
(Img.imgstrip("FGhost")[0], 0),
(Img.img2("SokoBlok"), 0),
(Img.img2("SokoLok"), 1),
(Img.img2("ExpBlock"), 1),
(Img.img2("Pen"), 0),
(Img.img2("ExBomb"), 0),
(Img.imgsz("GhostSpawn", (32, 40)), 1),
(Img.imgstrip2("Slime")[0], 0),
(Img.img2("CannonBlock"), 1),
(Img.img2("Men/SMan"), 0),