Exemplo n.º 1
0
Arquivo: server.py Projeto: smoak/TPS
def tmpDebugWorldRemoveMe():
    # THIS IS FOR DEBUG ONLY!!
    w = World(platformClock=reactor)
    w.time = 13500.0
    w.name = "Debug"
    w.width = 800
    w.height = 600
    w.spawn = (100, 199)
    w.isDay = True
    w.worldSurface = 200
    w.rockLayer = 400
    topLeftTs = TileSection()
    for y in range(4):
        w.tileSections.append([])
        for x in range(6):
            ts = TileSection()
            ts.x = x
            ts.y = y
            for ty in range(50, SECTION_HEIGHT):
                for tx in range(SECTION_WIDTH):
                    ts.setTile(tx, ty, ironTile)
            w.tileSections[y].append(ts)
    return w
Exemplo n.º 2
0
Arquivo: readers.py Projeto: smoak/TPS
 def readWorld(self):
   w = World()
   self.fileHandle = open(self.worldFilePath, 'rb')
   w.version = self.readInt32()
   worldNameLen = self.readUChar()
   w.name = self.fileHandle.read(worldNameLen)
   w.worldId = self.readInt32()
   w.leftWorld = self.readInt32()
   w.rightWorld = self.readInt32()
   w.topWorld = self.readInt32()
   w.bottomWorld = self.readInt32()
   w.height = self.readInt32()
   w.width = self.readInt32()
   spawnX = self.readInt32()
   spawnY = self.readInt32()
   w.spawn = (spawnX, spawnY)
   w.worldSurface = self.readDouble()
   w.rockLayer = self.readDouble()
   w.time = self.readDouble()
   w.isDay = self.readBoolean()
   w.moonPhase = self.readInt32()
   w.isBloodMoon = self.readBoolean()
   w.dungeonX = self.readInt32()
   w.dungeonY = self.readInt32()
   w.bossOneDowned = self.readBoolean()
   w.bossTwoDowned = self.readBoolean()
   w.bossThreeDowned = self.readBoolean()
   w.shadowOrbSmashed = self.readBoolean()
   w.spawnMeteor = self.readBoolean()
   w.shadowOrbCount = self.readUChar()
   w.invasionDelay = self.readInt32()
   w.invasionSize = self.readInt32()
   w.invasionType = self.readInt32()
   w.invasionX = self.readDouble()
   self.fileHandle.close()
   return w