示例#1
0
def create_level():
    global dungeon
    global weightedgrid
    global player
    global allenemies

    dungeon = level.Dungeon()

    player_room = dungeon.pick_random_room()
    player_spawn_point = player_room.pick_interior_point()
    player_spawn_point = tuple([c * TILE_SIZE for c in player_spawn_point])
    player = gameplay.Player(player_spawn_point[0], player_spawn_point[1], 0)

    num_enemies = random.randint(1, 5)

    for enemy in range(num_enemies):
        enemy_room = random.choice(dungeon.filter_rooms(player_room))
        enemy_spawn_point = enemy_room.pick_interior_point()
        enemy_spawn_point = tuple([c * TILE_SIZE for c in enemy_spawn_point])

        enemy = gameplay.Enemy(enemy_spawn_point[0], enemy_spawn_point[1], \
                random.randint(1, 2))
        allenemies.append(enemy)

    dungeon.place_ladder(player_room)

    weightedgrid = gameplay.WeightedTileGrid(MAP_WIDTH, MAP_HEIGHT)
    weightedgrid.getwalls(dungeon)

    da = display.DisplayArea()
    da.fill_area()
示例#2
0
文件: graphical.py 项目: Dumiy/Hearts
class Player():
    gamePlayer = d.Player()
    px = int()
    py = int()
    def __init__(self,px=0,py=0):
        self.px = px
        self.py = py
    def __str__(self):
        return self.px + self.py
    def __repr__(self):
        return str(self)
示例#3
0
def main():

    player = gameplay.Player('Phil')
    worldMap(player)
示例#4
0
def main():

    player = gameplay.Player('Phil')
    mission = 'Bear Hunt'
    missionProcessing(player, mission)
示例#5
0
def main():

    player = gameplay.Player('Phil')
    mainGameLoop(player)
示例#6
0
def main():

    player = gameplay.Player('Phil')
    hub = hubs.HUBLIST[1]  #use Phil and Riverwood as default placeholders
    adventureMode(player, hub)
示例#7
0
def main():

    player = gameplay.Player('Phil')
    travelEvent(player)
示例#8
0
def main():

    player = gameplay.Player('Phil')
    destination = hubs.HUBLIST[2] #uses riverwood as a starting point and astralis hq as a sample destination
    travelFunction(player, destination)