Ejemplo n.º 1
0
    def __init__(self, name, x, y, standalone = None, standaloneDesc = None):

        if standalone != None and standaloneDesc != None:
            self.image = standalone
            self.desc = standaloneDesc
        else:
            parser = JsonParser.Parser()
            parser.parse("GameConfig/ItemDatabase.json")
            ss = Spritesheet.spritesheet("Sprites/Spritesheets/pixelArt.png")

            self.image = ss.image_at(tuple(parser.settings[name]["coords"]), (0, 0, 0, 0))
            self.desc = parser.settings[name]["desc"]

        self.consumable = True
        self.name = name
        self.pickedUp = False

        self.spriteImage = sprite(self.image, x, y, self.name)
        self.spriteImage.description = self.desc

        self.invSlot = ""
Ejemplo n.º 2
0
    "east": "hero.x + hero.width >= 960",
    "north": "hero.y <= 1",
    "west": "hero.x <= 1",
    "south": "hero.y + hero.height >= 895"
}

oppDir = {"east": "west", "west": "east", "south": "north", "north": "south"}

startPositions = {
    "east": (20, 440),
    "north": (440, 800),
    "west": (930, 440),
    "south": (440, 80)
}

parser = JsonParser.Parser()
parser.parse("GameConfig/config.json")
musicActive = parser.settings['musicSettings']['music']
sfxActive = parser.settings['musicSettings']['SFX']
character = parser.settings['levelSettings']['player']
currentLevel = parser.settings['levelSettings']['starting_level']

previousLevel = 0
toExit = None

ss = Spritesheet.spritesheet("Sprites/" + character + "/character.png")
alpha = (0, 0, 0, 0)

parser.parse("Sprites/" + character + "/walkCycle.json")

charWalkCycleDown = parser.settings['Down']