Ejemplo n.º 1
0
        public void OnStart(QGetContent content)
        {
            Instantiate(new CavernWallBackground());

            using (var layer1 = content.Texture("map1_3").GetPartialTexture(new QRect(0, 0, 128, 128)))
            {
                QMapTools.SpawnObjects(layer1, Transform.Position, new QVec(16) * 4, (color, pos) =>
                {
                    if (color == new QColor(0, 150, 50))
                    {
                        Instantiate(new PlayerSpawner(), pos);
                    }
                    if (color == QColor.Black)
                    {
                        Instantiate(new Spikes(), pos);
                    }
                    if (color == new QColor(75, 60, 45))
                    {
                        Instantiate(new CavernFloorTile(), pos);
                    }
                    if (color == new QColor(35, 30, 20))
                    {
                        Instantiate(new CavernWalls(), pos);
                    }
                    if (color == new QColor(255, 0, 0))
                    {
                        Instantiate(new BatSpawner(), pos);
                    }
                });
            }
        }
Ejemplo n.º 2
0
        public void OnStart(QGetContent get)
        {
            Scene.SpriteRenderer.ClearColor = QColor.Black;

            Instantiate(new BackgroundRendering());

            QMapTools.SpawnObjects(get, "biomeMapFront", QVec.Zero, new QVec(64, 64), (c, v) =>
            {
                if (c == new QColor(0, 150, 50))                //player
                {
                    Instantiate(new Player(), v);
                }
                else if (c == new QColor(75, 60, 45))                //ground
                {
                    Instantiate(new BiomeFloor(), v);
                }
                else if (c == new QColor(35, 30, 20))                //walls
                {
                    Instantiate(new BiomeWall(), v);
                }
                else if (c == new QColor(255, 0, 0))               //bats
                {
                    Instantiate(new BiomeBat(), v);
                }
            });

            Instantiate(new PlayerCamera());
        }