예제 #1
0
 public Map(Splosion game, List <FireWork> events, TimeSpan timer)
 {
     Game     = game;
     Events   = events;
     Timer    = timer;
     MapTween = new Tween(timer, 0, 1);
 }
예제 #2
0
 public ExitableState(Splosion game) : base(game)
 {
     FadeTween = new Tween(new TimeSpan(0, 0, 0, 2), 0f, 1f);
     ExitTween = new Tween(new TimeSpan(0, 0, 0, 2), 1f, 1.1f, true);
     Mouse.LeftClickListeners.Add(CheckExit);
     //Touch.MoveListeners.Add(CheckExit);
     Touch.TapListeners.Add(CheckExit);
 }
예제 #3
0
 public BloomEffect(GraphicsDevice device)
 {
     _tween = new Tween(TimeSpan.FromSeconds(3), 1f, -1f, true);
     _bloom = new Effect(device, Splosion.LoadStream(@"Content\Effects\bloom.mgfxo"));
     _bloom.Parameters["BaseIntensity"].SetValue(.25f);
     _bloom.Parameters["BaseSaturation"].SetValue(.5f);
     _bloom.Parameters["BloomIntensity"].SetValue(1f);
     _bloom.Parameters["BloomSaturation"].SetValue(.75f);
 }
예제 #4
0
        public RippleEffect(GraphicsDevice device)
        {
            _tween  = new Tween(TimeSpan.FromSeconds(3), 1f, -1f, true);
            _ripple = new Effect(device, Splosion.LoadStream(@"Content\Effects\ripple.mgfxo"));
            _ripple.Parameters["wave"].SetValue(1.75f);
            _ripple.Parameters["distortion"].SetValue(0f);
            _ripple.Parameters["centerCoord"].SetValue(new Vector2(0.5f, 0.5f));
//            _ripple.Parameters["Phase"].SetValue(.5f);
        }
예제 #5
0
        public FreePlay(Splosion game)
            : base(game)
        {
            RSG         = PlayState.READY;
            ActionTween = new Tween(new TimeSpan(0, 0, 0, 1), 0, 1);
            ActionTween.AddEventListener(.5f, t =>
            {
                switch (RSG)
                {
                case PlayState.READY:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.SET:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.GO:
                    Game.Audio.Play(Sounds.Menu);
                    break;
                }
            });



            ActionTween.CompletionListeners.Add(t =>
            {
                switch (RSG)
                {
                case PlayState.READY:
                    Selector.ShowRadius = false;
                    Selector.SelectorListeners.Clear();
                    RSG = PlayState.SET;
                    ActionTween.Reset();
                    break;

                case PlayState.SET:
                    RSG = PlayState.GO;
                    ActionTween.Reset();
                    break;

                case PlayState.GO:
                    RSG = PlayState.PLAY;
                    Selector.ShowRadius = true;
                    Selector.SelectorListeners.Add(game.AddFireWorks);
                    break;

                case PlayState.PLAY:
                    break;
                }
            });
            Selector.SelectorListeners.Add(game.AddFireWorks);
            Mouse.LeftClickListeners.Add(Tap);
            Touch.TapListeners.Add(Tap);
        }
예제 #6
0
 public MainMenu(Splosion game) : base(game)
 {
     NextExplosion       = new TimeSpan(0, 0, 0, 1);
     PlayTween           = new Tween(new TimeSpan(0, 0, 0, 2), 1f, 1.1f, true);
     FreePlayTween       = new Tween(new TimeSpan(0, 0, 0, 2), 1.1f, 1f, true);
     RushTween           = new Tween(new TimeSpan(0, 0, 0, 2), 1f, 1.1f, true);
     ContinueTween       = new Tween(new TimeSpan(0, 0, 0, 2), 1.1f, 1f, true);
     FadeTween           = new Tween(new TimeSpan(0, 0, 0, 2), 0f, 1f);
     Selector.ShowRadius = false;
     Touch.TapListeners.Add(Tap);
     //Touch.MoveListeners.Add(Tap);
     Mouse.LeftClickListeners.Add(Tap);
 }
예제 #7
0
        public Rush(Splosion game)
            : base(game)
        {
            FirstRun        = true;
            ScoreParticles  = new List <MiniScore>();
            TimeParticles   = new List <TimeParticle>();
            MultiplierTween = new Tween(new TimeSpan(0, 0, 0, 4), 1, 0);
            MultiplierTween.Finish();
            CurrectSelectorTween = new Tween(new TimeSpan(0, 0, 0, 1), 1, 0);
            CurrectSelectorTween.Finish();
            StartTTL    = new TimeSpan(0, 0, 0, 4);
            CurrentTTL  = new TimeSpan(0, 0, 0, 4);
            MaxTTL      = new TimeSpan(0, 0, 0, 10);
            TTL         = StartTTL;
            RSG         = PlayState.KEEP_UP;
            ActionTween = new Tween(new TimeSpan(0, 0, 0, 1), 0, 1);
            ActionTween.AddEventListener(.5f, t =>
            {
                switch (RSG)
                {
                case PlayState.KEEP_UP:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.READY:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.SET:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.GO:
                    Game.Audio.Play(Sounds.Menu);
                    break;
                }
            });



            ActionTween.CompletionListeners.Add(t =>
            {
                switch (RSG)
                {
                case PlayState.KEEP_UP:
                    Selector.ShowRadius = false;
                    Selector.SelectorListeners.Clear();
                    RSG = PlayState.READY;
                    ActionTween.Reset();
                    break;

                case PlayState.READY:
                    Selector.ShowRadius = false;
                    Selector.SelectorListeners.Clear();
                    RSG = PlayState.SET;
                    ActionTween.Reset();
                    break;

                case PlayState.SET:
                    RSG = PlayState.GO;
                    ActionTween.Reset();
                    break;

                case PlayState.GO:
                    RSG = PlayState.ADD;
                    break;
                }
            });
            Selector.SelectorListeners.Add(game.AddFireWorks);
            Mouse.LeftClickListeners.Add(Tap);
            Touch.TapListeners.Add(Tap);
        }
예제 #8
0
        public Play(Splosion game, int gameScore = 0, int level = 0)
            : base(game)
        {
            GameScore      = gameScore;
            Level          = level;
            ScoreParticles = new List <MiniScore>();
            RecordEvents   = new List <FireWork>();
            HandFade       = new Tween(new TimeSpan(0, 0, 0, 1), 0, 0);
            HandMoveH      = new Tween(new TimeSpan(0, 0, 0, 1), Game.Center.X, Game.Center.X);
            HandMoveV      = new Tween(new TimeSpan(0, 0, 0, 1), Game.Center.Y, Game.Center.Y);
            SelectorFader  = new Tween(new TimeSpan(0, 0, 0, 3), 1, 0);
            SaveFadeTween  = new Tween(new TimeSpan(0, 0, 0, 1), 0, 1);
            SaveTween      = new Tween(new TimeSpan(0, 0, 0, 2), 1f, 1.1f, true);
            SavedTween     = new Tween(new TimeSpan(0, 0, 0, 1), 0, 1);
            SavedTween.Finish();

            Mouse.LeftClickListeners.Add(CheckSave);
            // Touch.MoveListeners.Add(CheckSave);
            Touch.TapListeners.Add(CheckSave);

            CreateMap();
            if (Game.ShownHint)
            {
                RSG = PlayState.WATCH;
            }
            else
            {
                Game.ShownHint = true;
                RSG            = PlayState.SHOW_HAND;
            }
            ActionTween = new Tween(new TimeSpan(0, 0, 0, 1), 0, 1);
            ActionTween.AddEventListener(.5f, t =>
            {
                switch (RSG)
                {
                case PlayState.WATCH:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.READY:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.SET:
                    Game.Audio.Play(Sounds.Menu);
                    break;

                case PlayState.GO:
                    Game.Audio.Play(Sounds.Menu);
                    break;
                }
            });
            ActionTween.CompletionListeners.Add(t =>
            {
                switch (RSG)
                {
                case PlayState.SHOW_HAND:
                    Selector.ShowRadius = false;
                    Selector.SelectorListeners.Clear();
                    HandFade = new Tween(new TimeSpan(0, 0, 0, 1), 0, 1);
                    RSG      = PlayState.HAND_RIGHT;
                    ActionTween.Reset();
                    break;

                case PlayState.HAND_RIGHT:
                    Selector.ShowRadius = false;
                    HandMoveH           = new Tween(new TimeSpan(0, 0, 0, 1), Game.Center.X, Game.Center.X + 100);
                    RSG = PlayState.HAND_LEFT;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 1));
                    break;

                case PlayState.HAND_LEFT:
                    Selector.ShowRadius = false;
                    HandMoveH           = new Tween(new TimeSpan(0, 0, 0, 2), Game.Center.X + 100, Game.Center.X - 200);
                    RSG = PlayState.HAND_UP;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 2));
                    break;

                case PlayState.HAND_UP:
                    Selector.ShowRadius = false;
                    HandMoveV           = new Tween(new TimeSpan(0, 0, 0, 1), Game.Center.Y, Game.Center.Y + 100);
                    RSG = PlayState.HAND_DOWN;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 1));
                    break;

                case PlayState.HAND_DOWN:
                    Selector.ShowRadius = false;
                    HandMoveV           = new Tween(new TimeSpan(0, 0, 0, 2), Game.Center.Y + 100, Game.Center.Y - 200);
                    RSG = PlayState.HIDE_HAND;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 2));
                    break;

                case PlayState.HIDE_HAND:
                    Selector.ShowRadius = false;
                    Game.AddFireWorks(new Vector2(Center.X - 52, Center.Y - Textures.Hand.Height), Color.Blue, 1);
                    HandFade = new Tween(new TimeSpan(0, 0, 0, 1), 1, 0);
                    RSG      = PlayState.WATCH;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 1));
                    break;

                case PlayState.WATCH:
                    Score = 0;
                    Selector.ShowRadius = false;
                    Selector.SelectorListeners.Clear();
                    RSG = PlayState.WAIT1;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 2));
                    break;

                case PlayState.WAIT1:
                    Selector.ShowRadius = false;
                    RSG = PlayState.VIEW;
                    CurrentMap.AddEvents();
                    SelectorFader.Reset();
                    ActionTween.Reset(CurrentMap.Timer);
                    break;

                case PlayState.VIEW:
                    Selector.ShowRadius = false;
                    RSG = PlayState.READY;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 1));
                    break;

                case PlayState.READY:
                    Selector.ShowRadius = false;
                    RSG = PlayState.SET;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 1));
                    break;

                case PlayState.SET:
                    Selector.ShowRadius = false;
                    CurrentMap.RemoveEvents();
                    RSG = PlayState.GO;
                    ActionTween.Reset();
                    break;

                case PlayState.GO:
                    RSG = PlayState.PLAY;
                    Selector.ShowRadius = true;
                    Selector.SelectorListeners.Add(AddFireWorks);
                    ActionTween.Reset(CurrentMap.Timer);
                    CurrentMap.MapTween.Reset();
                    RecordEvents.Clear();
                    ScoreParticles.Clear();
                    break;

                case PlayState.PLAY:
                    Selector.ShowRadius = false;
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 3));
                    RSG = PlayState.REVIEW;
                    break;

                case PlayState.REVIEW:
                    Selector.ShowRadius = false;
                    var numOfFW         = Math.Max(Math.Min(Level, MaxFireworksLevelTopOut), MinFireworks);
                    numOfFW             = (numOfFW / MaxFireworksLevelTopOut) * MaxFireworks;
                    numOfFW             = Math.Max(numOfFW, MinFireworks);
                    var rscore          = (int)((numOfFW * MiniScore.GetScoreFor(MiniScores.GOOD)));
                    if (Score >= rscore)
                    {
                        GameScore += Score;
                        Level++;
                    }
                    if (Score > Game.BestScore)
                    {
                        Game.BestScore = Score;
                    }
                    if (GameScore > Game.HighScore)
                    {
                        Game.HighScore = GameScore;
                    }
                    CreateMap();
                    ActionTween.Reset(new TimeSpan(0, 0, 0, 1));
                    RSG = PlayState.WATCH;
                    break;
                }
            });
        }