Beispiel #1
0
        /// <summary>
        /// Inititialise the special effects
        /// </summary>
        private void InitFX()
        {
            #if DEBUG
            NodeDebug debug = new NodeDebug(this, int.MaxValue);
            Add(debug);
            #endif

            if (initType == InitTypes.SolutionReplay)
            {
                // Exit
                return;
            }

            cursor = new NodeCursor(this, int.MaxValue);
            Add(cursor);

            if (initType == InitTypes.NewGame)
            {
                NodeEffectText start = new NodeEffectText(this, 10, "Welcome to SokoSolve, START!", Player.CurrentAbsolute);
                start.Brush = new SolidBrush(Color.FromArgb(80, Color.White));
                start.BrushShaddow = new SolidBrush(Color.FromArgb(80, Color.Black));
                start.Path = new Paths.Spiral(Player.CurrentCentre);
                Add(start);

                sound.PlaySound(sfxWelcome);

                sound.PlayMusic(sound.GetHandle("Camokaze-Low.mp3"));

            }
            else if (initType == InitTypes.Restart)
            {
                NodeEffectText start = new NodeEffectText(this, 10, "Starting again, eh?", Player.CurrentAbsolute);
                start.Brush = new SolidBrush(Color.FromArgb(180, Color.Gold));
                start.BrushShaddow = new SolidBrush(Color.FromArgb(180, Color.Black));
                start.Path = new Paths.Spiral(Player.CurrentCentre);
                Add(start);

                sound.PlaySound(sfxRestart);
            }
            else if (initType == InitTypes.Undo)
            {
                NodeEffectText start = new NodeEffectText(this, 10, new string[] { "Hmmm", "Grrr", "Pity", "???"}, GameCoords.WindowRegion.Center);
                start.Brush = new SolidBrush(Color.Cyan);
                Add(start);

                sound.PlaySound(sfxUndo);
            }

            NodeControllerStatus status = new NodeControllerStatus(this, 500);
            Add(status);

            NodeControllerCommands commands = new NodeControllerCommands(this, 501);
            Add(commands);

            NodeTitle title = new NodeTitle(this, 1000);
            Add(title);

            NodeControllerBookmarks waypoint = new NodeControllerBookmarks(this, 502);
            Add(waypoint);
        }
Beispiel #2
0
        /// <summary>
        /// Inititialise the special effects
        /// </summary>
        private void InitFX()
        {
            #if DEBUG
            NodeDebug debug = new NodeDebug(this, int.MaxValue);
            Add(debug);
            #endif

            if (initType == InitTypes.SolutionReplay)
            {
                // Exit
                return;
            }

            cursor = new NodeCursor(this, int.MaxValue);
            Add(cursor);

            if (initType == InitTypes.NewGame)
            {
                NodeEffectText start = new NodeEffectText(this, 10, "Welcome to SokoSolve, START!", Player.CurrentAbsolute);
                start.Brush = new SolidBrush(Color.FromArgb(80, Color.White));
                start.BrushShaddow = new SolidBrush(Color.FromArgb(80, Color.Black));
                start.Path = new Paths.Spiral(Player.CurrentCentre);
                Add(start);

                // Stop all music and sounds
                sound.Stop();
                sound.PlaySound(ResourceFactory[ResourceID.GameSoundWelcome].DataAsSound);

                string[] music = Directory.GetFiles(FileManager.GetContent("$Music/"), "*.mp3");
                sound.PlayMusic(sound.GetHandle(Path.GetFileName(RandomHelper.Select<string>(music))));

            }
            else if (initType == InitTypes.Restart)
            {
                NodeEffectText start = new NodeEffectText(this, 10, "Starting again, eh?", Player.CurrentAbsolute);
                start.Brush = new SolidBrush(Color.FromArgb(180, Color.Gold));
                start.BrushShaddow = new SolidBrush(Color.FromArgb(180, Color.Black));
                start.Path = new Paths.Spiral(Player.CurrentCentre);
                Add(start);

                sound.PlaySound(ResourceFactory[ResourceID.GameSoundRestart].DataAsSound);
            }
            else if (initType == InitTypes.Undo)
            {
                NodeEffectText start = new NodeEffectText(this, 10, new string[] { "Hmmm", "Grrr", "Pity", "???"}, GameCoords.WindowRegion.Center);
                start.Brush = new SolidBrush(Color.Cyan);
                Add(start);

                sound.PlaySound(ResourceFactory[ResourceID.GameSoundUndo].DataAsSound);
            }

            NodeControllerStatus status = new NodeControllerStatus(this, 500);
            Add(status);

            NodeControllerCommands commands = new NodeControllerCommands(this, 501);
            Add(commands);

            NodeTitle title = new NodeTitle(this, 1000);
            Add(title);

            NodeControllerBookmarks waypoint = new NodeControllerBookmarks(this, 502);
            Add(waypoint);
        }