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


Python Map.getInstance方法代码示例

本文整理汇总了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()
开发者ID:dcarlton,项目名称:Madoka-Roguelike,代码行数:23,代码来源:Graphics.py

示例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"
开发者ID:dcarlton,项目名称:Madoka-Roguelike,代码行数:33,代码来源:Homura.py


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