Esempio n. 1
0
def spawn_enemies(x, map=None):
    if map == None:
        map = terrain.map
    #spawns enemies on random spot on top and bottom of map
    obj = mob.get_random_mob(mob.moblist)((x, 0), 1)
    obj.faction = 1
    spawn_mob(obj, map)
    obj = mob.get_random_mob(mob.moblist)((x, map.height - 1), 2)
    obj.faction = 2
    spawn_mob(obj, map)
Esempio n. 2
0
def randomly_spawn_enemies():
    y = random.randint(0, terrain.map.height - 1)

    if random.randint(1, 3) == 1:
        f = 1
        x = 0
    elif player.x + terrain.map.scroll_amount <= VICTORY_DISTANCE - MAP_WIDTH / 2:
        f = 2
        x = terrain.map.width - 1
    else:
        return

    obj = mob.get_random_mob(mob.moblist)((x, y), f)
    spawn_mob(obj)