コード例 #1
0
ファイル: Level.cs プロジェクト: Danvil/ld26_minimal
    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
ファイル: Level.cs プロジェクト: Danvil/ld26_minimal
 void PlanShapes(bool isboss)
 {
     LevelShapePlacer.Place(levelPlan, isboss);
 }