示例#1
0
    void PlanEnemies(int area, float mul)
    {
        int        num     = MoreMath.RandomRound((float)(area) * mul / 12.0f);
        List <Loc> locs    = LevelShapePlacer.GetFreeLocations(levelPlan).Randomize().ToList();
        int        numfree = locs.Count;
        int        k       = 0;
        int        placed  = 0;

        foreach (Loc p in locs)
        {
            k += num;
            if (k >= numfree)
            {
                k -= numfree;
                levelPlan[p.y, p.x] = 8;
                placed++;
                if (placed == num)
                {
                    return;
                }
            }
        }
    }
示例#2
0
 void PlanShapes(bool isboss)
 {
     LevelShapePlacer.Place(levelPlan, isboss);
 }