Example #1
0
        /// <summary>
        /// Creatres new plat based on chart
        /// </summary>
        /// <param name="Chart">Chart to create play from</param>
        public ChotaikoPlay(ChotaikoChart Chart)
        {
            this.PlayObjects = new List <IChotaikoPlayObject>();

            // Convert chart objects to play objects
            for (int i = 0; i < Chart.Objects.Count; i++)
            {
                this.PlayObjects.Add(Chart.Objects[i].AsPlayObject());
            }
        }
Example #2
0
        /// <summary>
        /// Creates a game context given a certain chart
        /// </summary>
        /// <param name="Chart">Chart to create game context from</param>
        public ChotaikoGameContext(ChotaikoChart Chart)
        {
            this.Chart         = Chart;
            this.PauseTime     = TimeSpan.Zero;
            this.Start         = DateTime.Now;
            this.CurrentOffset = TimeSpan.Zero;
            this.CurrentID     = 0;

            this.OnScreenObjects = new List <IChotaikoGameObject>();
            this.CurrentPlay     = new ChotaikoPlay(this.Chart);
        }
Example #3
0
        static void Main()
        {
            ChotaikoChart       TestChart       = new ChotaikoChart(new System.IO.StreamReader(@"../../TestChart.ctc"));
            ChotaikoGameContext TestGameContext = new ChotaikoGameContext(TestChart);

            ChotaikoGlobalContext.SetGameContext(TestGameContext);
            // The 'using' idiom guarantees proper resource cleanup.
            // We request 30 UpdateFrame events per second, and unlimited
            // RenderFrame events (as fast as the computer can handle).
            using (Chotaiko game = new Chotaiko())
            {
                game.KeyDown += ChotaikoOnKeyDown;
                game.Run(30.0);
            }
        }