本文整理汇总了Python中Map.Map.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Python Map.getInstance方法的具体用法?Python Map.getInstance怎么用?Python Map.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map.Map
的用法示例。
在下文中一共展示了Map.getInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: drawPlayState
# 需要导入模块: from Map import Map [as 别名]
# 或者: from Map.Map import getInstance [as 别名]
def drawPlayState(self, player):
self.screen.fill((255, 255, 255))
for column in Map.getInstance().grid:
for cell in column:
if len(cell.beings) != 0:
self.drawCharacter(cell.beings[-1])
if cell.barrier:
self.screen.blit(Images.getInstance().getImage(Sprites.KYOKO_BARRIER), pygame.Rect(cell.x * 16, cell.y * 16, 16, 16))
if isinstance(player, Homura):
if player.timeStopped:
self.screen.blit(Images.getInstance().getImage(Sprites.TIME_STOP_EFFECT), pygame.Rect(0, 0, 144, 144))
player.image.set_colorkey((255, 255, 255))
self.drawCharacter(player)
if player.targeting is not None:
targetRect = pygame.Rect(player.targetX * 16, player.targetY * 16, 16, 16)
self.screen.blit(Images.getInstance().getImage(Sprites.TARGET_CURSOR), targetRect)
pygame.display.flip()
示例2: Homura
# 需要导入模块: from Map import Map [as 别名]
# 或者: from Map.Map import getInstance [as 别名]
import pygame
from CombatUtils import CombatUtils
from Constants import *
from Enumerations import *
from Event import Event
from Images import Images
from MagicalGirl import MagicalGirl
from Map import Map
from TurnManager import TurnManager
board = Map.getInstance()
turnManager = TurnManager.getInstance()
class Homura(MagicalGirl):
def __init__(self):
super(Homura, self).__init__()
self.image = Images.getInstance().getImage(Sprites.HOMURA_STANDING)
self.rect = self.image.get_rect()
self.bombs = []
self.timeStopped = False
self.abilityOneName = "Golf Club"
self.abilityOneDamage = 10
self.abilityOneMagic = 5
self.abilityOneRange = 1
self.abilityOneStatus = None
self.abilityOneTargeted = True
self.abilityOneTargets = Victims.NON_PLAYER_AND_HUMAN
self.abilityTwoName = "Pistol"