Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ConfettiId,ConfettiName,Active,Image")] Confetti confetti)
        {
            if (id != confetti.ConfettiId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(confetti);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ConfettiExists(confetti.ConfettiId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(confetti));
        }
Пример #2
0
 public SceneEight(SceneManager manager) : base(manager)
 {
     timeLength            = 4.0f;
     permitUnloadResources = false;
     bigHeadProp           = new BigHeadProp(resourceFactory);
     confetti = new Confetti();
 }
Пример #3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            cardSlot  = Content.Load <Texture2D>("ui/card_slot");
            cardBack  = Content.Load <Texture2D>("deck/card_back_green");
            refreshMe = Content.Load <Texture2D>("ui/refresh");
            newGame   = Content.Load <Texture2D>("ui/new_game");
            metaSmug  = Content.Load <Texture2D>("ui/smug-logo");
            debug     = Content.Load <Texture2D>("ui/wrench");
            undo      = Content.Load <Texture2D>("ui/undo");
            solve     = Content.Load <Texture2D>("ui/solve");
            paused    = Content.Load <Texture2D>("ui/paused");
            debugFont = Content.Load <SpriteFont>("ui/Arial");

            soundFX = new List <SoundEffect> {
                Content.Load <SoundEffect>("audio/card-kick"),
                Content.Load <SoundEffect>("audio/card-parent"),
                Content.Load <SoundEffect>("audio/card-play"),
                Content.Load <SoundEffect>("audio/card-restack"),
                Content.Load <SoundEffect>("audio/card-undo"),
                Content.Load <SoundEffect>("audio/card-bounce")
            };

            gameWinFX = Content.Load <SoundEffect>("audio/game-win");
            popFX     = Content.Load <SoundEffect>("audio/pop");

            dragonDrop = new DragonDrop <IDragonDropItem>(this, viewport);


            // table creates a fresh table.deck
            table = new TableClassic(this, spriteBatch, dragonDrop, cardBack, cardSlot, 20, 30, soundFX);

            table.muteSound = Properties.Settings.Default.mute;

            // load up the card assets for the new deck
            foreach (var card in table.drawPile.cards)
            {
                var location = "deck/" + card.suit + card.rank;
                card.SetTexture(Content.Load <Texture2D>(location));
            }

            table.InitializeTable();

            table.SetTable();

            Components.Add(dragonDrop);

            // more confetti stuff
            var textures = new List <Color> {
                new Color(255, 234, 142),
                new Color(129, 232, 138),
                new Color(239, 133, 189)
            }.Select(c => GeometricTextureFactory.Rectangle(GraphicsDevice, 10, 18, c))
            .ToList().AsReadOnly();

            confetti = new Confetti(textures);
        }
Пример #4
0
    private void SpawnConfetti()
    {
        float    width            = transform.GetComponent <RectTransform>().rect.width;
        float    height           = transform.GetComponent <RectTransform>().rect.height;
        Vector2  anchoredPosition = new Vector2(Random.Range(-width / 2f, width / 2f), height / 2f);
        Color    color            = colorArray[Random.Range(0, colorArray.Length)];
        Confetti confetti         = new Confetti(pfConfetti, transform, anchoredPosition, color, -height / 2f);

        confettiList.Add(confetti);
    }
Пример #5
0
        private void SpawnConfetti()
        {
            float width  = FindObjectOfType <Canvas> ().GetComponent <RectTransform> ().rect.width;
            float height = FindObjectOfType <Canvas> ().GetComponent <RectTransform> ().rect.height;

            Vector2  anchoredPosition = new Vector2(Random.Range(-width / 2f, width / 2f), height / 2f);
            Confetti confetti         = new Confetti(pfConfetti, transform, anchoredPosition, -height / 2f);

            _confList.Add(confetti);
        }
Пример #6
0
        public async Task <IActionResult> Create([Bind("ConfettiId,ConfettiName,Active,Image")] Confetti confetti)
        {
            if (ModelState.IsValid)
            {
                _context.Add(confetti);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(confetti));
        }
Пример #7
0
    void OnDisable()
    {
        Fireworks.SetActive(false);
        Confetti.SetActive(false);
        Stars1.SetActive(false);
        Stars2.SetActive(false);

        SlotFull.SetActive(false);
        AssignedSlot.SetActive(false);
        if (Regeneration.instance != null)
        {
            Regeneration.instance.LifeLoseAnim();
        }
    }
Пример #8
0
    public void OnWin()
    {
        Fireworks.SetActive(true);
        Confetti.SetActive(true);

        Stars1.SetActive(true);


        SnakesSpawner.instance.playerSnake.isBot = true;
        Result.text         = "You Win !!";
        PlayerNames[0].text = InGameGUI.instance.PlayerPanel[0].PlayerName.text;
        PlayerNames[1].text = InGameGUI.instance.PlayerPanel[1].PlayerName.text;

        PlayerImage[0].sprite = InGameGUI.instance.PlayerPanel[0].Shape.sprite;
        PlayerImage[0].color  = InGameGUI.instance.PlayerPanel[0].Shape.color;

        PlayerImage[1].sprite = InGameGUI.instance.PlayerPanel[1].Shape.sprite;
        PlayerImage[1].color  = InGameGUI.instance.PlayerPanel[1].Shape.color;

        //GameSparkRequests req = new GameSparkRequests();
        //req.Request("AddGold", "amt", "50", UpdateAccountDetails);


        GiveRewards();
        AccountDetails.instance.Save(totalWins: 1);


        Invoke("ShowRewards", 1f);

        if (PhotonNetwork.inRoom || ObliusGameManager.BotType == 1)
        {
            //RewardWindow.transform.DOMove (
            //GSUpdateMMR.instance.UpdateMMR(25);

            AccountDetails.instance.Save(MMR: 25);

            MMR[0].text = "+25";
            MMR[1].text = "-25";
        }
        else
        {
            MMR[0].text = "0";
            MMR[1].text = "0";
        }
        //print ("Win");
    }
 protected override void OnDisappearing()
 {
     base.OnDisappearing();
     Confetti.Stop();
 }
 protected override void OnAppearing()
 {
     base.OnAppearing();
     Confetti.Start();
 }
Пример #11
0
 public ScrollLetters(Confetti confetti)
 {
     this.confetti = confetti;
 }
Пример #12
0
 public SceneNine(SceneManager manager, Confetti confetti) : base(manager)
 {
     timeLength    = 2.0f;
     this.confetti = confetti;
 }
Пример #13
0
 public ScrollLetters(Confetti confetti)
 {
     this.confetti = confetti;
 }
Пример #14
0
 public SceneNine(SceneManager manager, Confetti confetti)
     : base(manager)
 {
     timeLength = 2.0f;
     this.confetti = confetti;
 }
Пример #15
0
 public void Start()
 {
     instance = this;
 }