예제 #1
0
        private void formNumberQuantityChanged(object sender, EventArgs e)
        {
            FormAddSneaker formNumberQuantity = (FormAddSneaker)sender;

            if (!formNumberQuantity.Visible)
            {
                Sneakers.Add(formNumberQuantity.sneaker);
                checkedListBoxSneakers.Items.Clear();
                checkedListBoxSneakers.Items.AddRange(Sneakers.Select(s => "Númeração: " + s.Number.ToString() + " - Quantidade: " + s.Quantity.ToString()).ToArray());
                formNumberQuantity.Dispose();
            }
        }
예제 #2
0
        public void ResetLevel()
        {
            TilesSolid.Clear();
            TilesOneWayPlatform.Clear();
            TilesSpike.Clear();
            Apples.Clear();
            Grounders.Clear();
            Flyer.Clear();
            windRs.Clear();
            Sneakers.Clear();
            SneakerTimers.Clear();

            if (windDir != Direction.None)
            {
                PreLoadWind(random);
            }

            for (var j = 0; j < LEVEL_HEIGHT; j++)
            {
                for (var i = 0; i < LEVEL_WIDTH; i++)
                {
                    switch (tilemap[i, j])
                    {
                    case Tile.Player:
                        InitializePlayer(i * 16, j * 16);
                        break;

                    case Tile.Goal:
                        goal = new Hitbox(i * 16, j * 16, 16, 16);
                        break;

                    case Tile.Wall:
                        TilesSolid.Add(new Hitbox(i * 16, j * 16, 16, 16));
                        break;

                    case Tile.NoGrapple:
                        TilesSolid.Add(new Hitbox(i * 16, j * 16, 16, 16));
                        break;

                    case Tile.OneWayPlatform:
                        TilesOneWayPlatform.Add(new Hitbox(i * 16, j * 16, 16, 16));
                        break;

                    case Tile.Spike:
                        TilesSpike.Add(new Hitbox(i * 16, j * 16 + 8, 16, 8));
                        break;

                    case Tile.Apple:
                        Apples.Add(new Hitbox(i * 16 + 2, j * 16 + 2, 12, 12));
                        break;

                    case Tile.Grounder:
                        Grounders.Add(new Mobile(i * 16, j * 16, GROUNDER_SPEED, 0, 16, 16));
                        break;

                    case Tile.Flyer:
                        Flyer.Add(new Mobile(i * 16, j * 16, FLYER_SPEED, 0, 16, 16));
                        break;

                    case Tile.Sneaker:
                        Sneakers.Add(new Hitbox(i * 16, j * 16, 16, 16));
                        SneakerTimers.Add(-1);
                        break;
                    }
                }
            }
        }