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()
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)
def main(): player = gameplay.Player('Phil') worldMap(player)
def main(): player = gameplay.Player('Phil') mission = 'Bear Hunt' missionProcessing(player, mission)
def main(): player = gameplay.Player('Phil') mainGameLoop(player)
def main(): player = gameplay.Player('Phil') hub = hubs.HUBLIST[1] #use Phil and Riverwood as default placeholders adventureMode(player, hub)
def main(): player = gameplay.Player('Phil') travelEvent(player)
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)