Ejemplo n.º 1
0
        public override string OnUpdate(Keyboard keyboard, Mouse mouse, GameCore.Timing.Timer timer)
        {
            if (!Bingo.instance.TopMost)
            {
                Bingo.instance.TopMost = true;
            }
            switch (loadingPart)  // "...Loading Sounds..."
            {
            case 0: lblAction.Text = "...Loading Sounds...";
                break;

            case 1: mediaObjs.LoadFile("Sounds.txt"); lblAction.Text = "...Loading Fonts...";
                break;

            case 2: mediaObjs.LoadFile("Fonts.txt"); lblAction.Text = "...Loading Animations...";
                break;

            case 3: mediaObjs.LoadFile("Animations.txt"); lblAction.Text = "...Loading Bitmaps...";
                break;

            case 4: mediaObjs.LoadFile("Bitmaps.txt"); lblAction.Text = "...Loading Main State...";
                break;

            case 5: stateMachine.Add(new StateMain());
                break;

/*
 *              case 6: stateMachine.Add(new StateTitle()); lblAction.Text = "...Loading PIN State...";
 *                  break;
 *              case 7: stateMachine.Add(new StatePIN()); lblAction.Text = "...Loading Main State...";
 *                  break;
 *              case 8: stateMachine.Add(new StateDemo()); lblAction.Text = "...Loading Attraction State...";
 *                  break;
 *              case 9: stateMachine.Add(new StateAttraction()); lblAction.Text = "...Loading Game Menu State...";
 *                  break;
 *              case 10: stateMachine.Add(new StateGameMenu());
 *                  break;
 */
            default:
            {
                return("Main");
            }
            }

            loadingPart++;

            guiManager.Update(keyboard, mouse, timer);
            return("NoChange");
        }
Ejemplo n.º 2
0
        void updateTransitions(Keyboard keyboard, Mouse mouse, GameCore.Timing.Timer timer)
        {
            if (!transitionDone)
            {
                almTransDelay.Update(timer.DeltaTimeMS);

                if (freeTabsMode)
                {
                    if (almTransDelay.Check(Alarm.CheckType.RESET))
                    {
                        picMainBackGround.Alpha -= 0.04f;
                        picMainOverlay.Alpha    += 0.04f;
                        if (picMainBackGround.Alpha <= 0f && picMainOverlay.Alpha >= 1f)
                        {
                            picMainBackGround.Visible = false;
                            picMainOverlay.Visible    = true;
                            transitionDone            = true;
                        }
                    }
                }
                else
                {
                    if (almTransDelay.Check(Alarm.CheckType.RESET))
                    {
                        picMainBackGround.Alpha += 0.04f;
                        picMainOverlay.Alpha    -= 0.04f;
                        if (picMainBackGround.Alpha >= 1f && picMainOverlay.Alpha <= 0f)
                        {
                            picMainBackGround.Visible = true;
                            picMainOverlay.Visible    = false;
                            transitionDone            = true;
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public override string OnUpdate(Keyboard keyboard, Mouse mouse, GameCore.Timing.Timer timer)
        {
            guiManager.Update(keyboard, mouse, timer);

            currentState.OnUpdate(keyboard, mouse, timer);

            //calculate cost from controls...
            costForReveal = TabPrices[tabPricesIdx];
            if (odoBalance.Value != pinBalance)
            {
                odoBalance.Value = pinBalance;
            }


            lblWon.Text  = wonAmount.ToString("C");
            lblCost.Text = (freeTabsMode)?"Bonus":costForReveal.ToString("C");

            updateTransitions(keyboard, mouse, timer);

            if (totalWinSign.active == false && totalWinSign.phase == 1)
            {
                almTotalWinSign.Update(timer.DeltaTimeMS);
                if (almTotalWinSign.Check(Alarm.CheckType.RESET))
                {
                    totalWinSign.endAnimation();
                }
            }

            //update free tabs meters...

            if (freeTabsMode)
            {
                odoFreeTabs.Value = freeTabsBalance;

                btnRevealAll.Enable = btnContinue.Enable = false;
            }
            else
            {
                almMeterCycle.Update(timer.DeltaTimeMS);
                if (almMeterCycle.Check(Alarm.CheckType.RESET))
                {
                    do
                    {
                        curFreeTabsCycle++;
                        if (curFreeTabsCycle >= Definitions.freeTabsPayTable.Length)
                        {
                            curFreeTabsCycle = 0;
                        }
                    } while (!Definitions.freeTabsPayTable[curFreeTabsCycle].isCherry);
                    //lblFreeTabsNo.Text = scatters[curFreeTabsCycle].scatters.ToString();
                    lblFreeTabs.Text = "   X " + Definitions.freeTabsPayTable[curFreeTabsCycle].repeatitions.ToString() + "\r\n" +
                                       Definitions.freeTabsPayTable[curFreeTabsCycle].FreeTabs.ToString() + " tabs";
                }
            }

            if (Bingo.singleton.localSettings.IsSpin)
            {
                for (int i = 0; i < 3; i++)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        if (SpinningReelAnims[i, j] != null)

                        {
                            if (SpinningReelAnims[i, j].IsPlaying())
                            {
                                if (i < 2)
                                {
                                    if (SpinningReelAnims[i + 1, j] == null && SpinningReelAnims[i, j].GetFrame() > 3)
                                    {
                                        SpinReel(i + 1);
                                    }

                                    if (SpinningReelAnims[i, j].GetFrame() > 2 && !iconsView.HideCol[i, j])
                                    {
                                        iconsView.HideCol[i, j] = true;
                                    }
                                }
                                else
                                {
                                    if (SpinningReelAnims[i, j].GetFrame() > 2 && !iconsView.HideCol[i, j])
                                    {
                                        iconsView.HideCol[i, j] = true;
                                    }
                                }
                            }
                            else
                            {
                                iconsView.HideCol[i, j] = false;
                                Animations.Remove(SpinningReelAnims[i, j]);
                                if (reelSpinning[i, j])
                                {
                                    reelSpinning[i, j] = false;
                                    if (soundsOn)
                                    {
                                        Sounds.reelStop.Stop(true);
                                        Sounds.reelStop.Play(false, true);
                                        if (i == 2)
                                        {
                                            Sounds.reelSpin.Stop(true);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return("");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Updates the card test for card Presses if state is set to selecting
        /// </summary>
        /// <param name="mouse">current Mouse object</param>
        /// <param name="timer">current Timer Object</param>
        protected override void OnUpdate(GameCore.Input.Keyboard keyboard, GameCore.Input.Mouse mouse, GameCore.Timing.Timer timer)
        {
            if (!Active)
            {
                return;
            }
            almDelay.Update(timer.DeltaTimeMS);

            if (almDelay.Check(Alarm.CheckType.RESET))
            {
                if (objValue != curValue)
                {
                    if (StateMain.singleton.soundsOn)
                    {
                        StateMain.singleton.Sounds.odoTick.Play(false, true);
                    }

                    if (Math.Abs(objValue - curValue) < Math.Abs(step))
                    {
                        curValue = objValue;
                    }
                    else
                    {
                        curValue += step;
                    }
                }

                txtCounter.Text = curValue.ToString(format);
                if (txtCounter.Text == "")
                {
                    txtCounter.Text = "0";
                }
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Updates the card test for card Presses if state is set to selecting
 /// </summary>
 /// <param name="mouse">current Mouse object</param>
 /// <param name="timer">current Timer Object</param>
 protected override void OnUpdate(GameCore.Input.Keyboard keyboard, GameCore.Input.Mouse mouse, GameCore.Timing.Timer timer)
 {
     if (status == iconStatus.Concealed)
     {
         if (Released && (StateMain.singleton.currentState == StateMain.singleton.stPlay || StateMain.singleton.currentState == StateMain.singleton.stCredit))
         {
             //if (StateMain.singleton.soundsOn)
             //{
             //    StateMain.singleton.Sounds.iconReveal.Stop(true);
             //    StateMain.singleton.Sounds.iconReveal.Play(false, true);
             //}
             //Reveal();
             //if(!((StPlay)StateMain.singleton.stPlay).autoReveal)
             //StateMain.singleton.saveRecoveryRecord();   //every icon should be updated...
         }
     }
     else if (status == iconStatus.Revealing)
     {
         almCoverAnim.Update(timer.DeltaTimeMS);
         if (almCoverAnim.Check(Alarm.CheckType.RESET))
         {
             coverAnimFrame++;
             if (coverAnimFrame >= Definitions.CoverAnimationFrames)
             {
                 IconsView.singleton.iconsRevealed++;
                 status = iconStatus.Revealed;
             }
         }
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Updates the card test for card Presses if state is set to selecting
        /// </summary>
        /// <param name="mouse">current Mouse object</param>
        /// <param name="timer">current Timer Object</param>
        protected override void OnUpdate(GameCore.Input.Keyboard keyboard, GameCore.Input.Mouse mouse, GameCore.Timing.Timer timer)
        {
            foreach (Icon icon in icons)
            {
                icon.Update(keyboard, mouse, timer);
            }

            foreach (AnimatedLabel anim in StateMain.singleton.Animations)
            {
                anim.Update(keyboard, mouse, timer);
            }

            if (StateMain.singleton.currentState == StateMain.singleton.stWin && (((StPlay)StateMain.singleton.stPlay).winnings > 0 || ((StPlay)StateMain.singleton.stPlay).freeTabsWon > 0))
            {
                //almChangeFlashingLine.Update(timer.DeltaTimeMS);
                //almFlashLines.Update(timer.DeltaTimeMS);
                int tempFrm = 0;
                if (StateMain.singleton.Animations.Count > 0)
                {
                    tempFrm = StateMain.singleton.Animations[0].GetFrame();

                    if (tempFrm % 7 == 0 && lastFrm != tempFrm && tempFrm != 28)
                    {
                        lastFrm     = tempFrm;
                        lineShowing = !lineShowing;
                        if (lineShowing)
                        {
                            lineFlashesSoFar++;
                        }
                    }

                    //Debug.WriteLine(lineShowing + " - " + tempFrm + " - " + lastFrm + " - " + curLineFlashing);
                }


                if ((tempFrm >= 28) || firstWinFlag)
                {
                    lineFlashesSoFar = 0;
                    curLineFlashing  = (firstWinFlag)?getFirstWinLine():getNextWinLine(curLineFlashing);

                    StateMain.singleton.lblLineAmount.Text = "Pattern " + (curLineFlashing + 1).ToString() + " pays " + ((StPlay)StateMain.singleton.stPlay).finalLineAmounts[curLineFlashing].ToString("C");

                    StateMain.singleton.Animations.Clear();
                    startWinnerIconAnims(((StPlay)StateMain.singleton.stPlay).finalNoOfIconsWon, curLineFlashing, ((StPlay)StateMain.singleton.stPlay).finalLineAmounts);
                    if (((StPlay)StateMain.singleton.stPlay).freeTabsWon > 0)
                    {
                        animateFreeTabsIcon();
                    }

                    firstWinFlag = false;
                }
            }
        }
Ejemplo n.º 7
0
        public override string OnUpdate(Keyboard keyboard, Mouse mouse, GameCore.Timing.Timer timer)
        {
            guiManager.Update(keyboard, mouse, timer);

            currentState.OnUpdate(keyboard, mouse, timer);

            //calculate cost from controls...
            costForReveal = TabPrices[tabPricesIdx];
            if (odoBalance.Value != pinBalance)
            {
                odoBalance.Value = pinBalance;
            }


            lblWon.Text  = wonAmount.ToString("C");
            lblCost.Text = (freeTabsMode)?"Bonus":costForReveal.ToString("C");

            updateTransitions(keyboard, mouse, timer);

            if (totalWinSign.active == false && totalWinSign.phase == 1)
            {
                almTotalWinSign.Update(timer.DeltaTimeMS);
                if (almTotalWinSign.Check(Alarm.CheckType.RESET))
                {
                    totalWinSign.endAnimation();
                }
            }

            //update free tabs meters...

            if (freeTabsMode)
            {
                odoFreeTabs.Value = freeTabsBalance;

                btnRevealAll.Enable = btnContinue.Enable = false;
            }
            else
            {
                almMeterCycle.Update(timer.DeltaTimeMS);
                if (almMeterCycle.Check(Alarm.CheckType.RESET))
                {
                    do
                    {
                        curFreeTabsCycle++;
                        if (curFreeTabsCycle >= Definitions.freeTabsPayTable.Length)
                        {
                            curFreeTabsCycle = 0;
                        }
                    } while (!Definitions.freeTabsPayTable[curFreeTabsCycle].isCherry);
                    //lblFreeTabsNo.Text = scatters[curFreeTabsCycle].scatters.ToString();
                    lblFreeTabs.Text = "   X " + Definitions.freeTabsPayTable[curFreeTabsCycle].repeatitions.ToString() + "\r\n" +
                                       Definitions.freeTabsPayTable[curFreeTabsCycle].FreeTabs.ToString() + " bonus tabs";
                }
            }

            //if (freeTabsMode && !Sounds.enterFreeTabs.Playing() && !Sounds.freeTabsLoop.Playing())
            //{

            //}

            return("");
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Updates the card test for card Presses if state is set to selecting
 /// </summary>
 /// <param name="mouse">current Mouse object</param>
 /// <param name="timer">current Timer Object</param>
 protected override void OnUpdate(GameCore.Input.Keyboard keyboard, GameCore.Input.Mouse mouse, GameCore.Timing.Timer timer)
 {
     if (active && ka != null)
     {
         ka.Update(keyboard, mouse, timer);
         if (ka.isDone())
         {
             active = false;
         }
     }
 }