コード例 #1
0
ファイル: objecttest.py プロジェクト: xjzpguob/libRPG
 def __init__(self):
     map_file = 'objecttest.map'
     lower_tile_image = tileset_path('town2.png')
     lower_bnd_file = tileset_path('town2.bnd')
     upper_tile_image = tileset_path('world_upper.png')
     upper_bnd_file = tileset_path('world_upper.bnd')
     MapModel.__init__(self, map_file,
                       (lower_tile_image, lower_bnd_file),
                       [(upper_tile_image, upper_bnd_file), ])
コード例 #2
0
ファイル: bouldertest.py プロジェクト: Eronarn/libRPG
 def __init__(self):
     MapModel.__init__(self, 'bouldertest.map',
                       (tileset_path('city_lower.png'),
                        tileset_path('city_lower.bnd')),
                       [(tileset_path('world_upper.png'),
                         tileset_path('world_upper.bnd'))])
コード例 #3
0
ファイル: itembase.py プロジェクト: Eronarn/libRPG
 def get_icon_location(self):
     return (tileset_path('world_upper.png'), 2)
コード例 #4
0
ファイル: itembase.py プロジェクト: Eronarn/libRPG
 def get_icon_location(self):
     return (tileset_path('city_upper.png'), 63)
コード例 #5
0
from librpg.world import WorldMap
from librpg.mapobject import ScenarioMapObject, MapObject
from librpg.maparea import RectangleArea, MapArea
from librpg.util import Position
from librpg.movement import Face, Wait
from librpg.dialog import MessageDialog
from librpg.locals import RIGHT, DOWN, LEFT, UP
from librpg.path import tileset_path, charset_path
from librpg.collection.maparea import RelativeTeleportArea

SAVE_FILE = 'save'
LOWER_TILESET = (tileset_path('city_lower.png'),
                 tileset_path('city_lower.bnd'))
UPPER_TILESET = [(tileset_path('world_upper.png'),
                  tileset_path('world_upper.bnd'))]

class SavePoint(ScenarioMapObject):

    def __init__(self, map):
        ScenarioMapObject.__init__(self, map, 0, 1)

    def activate(self, party_avatar, direction):
        self.map.schedule_message(MessageDialog('You game will be saved to %s.'
                                  % SAVE_FILE, block_movement=True))
        self.map.save_world(SAVE_FILE)
        self.map.schedule_message(MessageDialog('Game saved.',
                                                block_movement=True))


class Chest(MapObject):
コード例 #6
0
 def __init__(self):
     MapModel.__init__(
         self, 'itempersisttest.map',
         (tileset_path('city_lower.png'), tileset_path('city_lower.bnd')),
         [(tileset_path('world_upper.png'), tileset_path('world_upper.bnd'))
          ])
コード例 #7
0
ファイル: itembase.py プロジェクト: xjzpguob/libRPG
 def get_icon_location(self):
     return (tileset_path('world_upper.png'), 2)
コード例 #8
0
ファイル: itembase.py プロジェクト: xjzpguob/libRPG
 def get_icon_location(self):
     return (tileset_path('city_upper.png'), 63)