Example #1
0
        void CGame_Loaded(object sender, RoutedEventArgs e)
        {
            #region GameLogic Init
            _h = new GameLoopHandler(this, this.LayoutRoot, this._floor_canvas, this._food_canvas, this._snake_canvas);
            if (_h.Init())
            {
                return;
            }
            #endregion

            #region FPS
            this.LayoutRoot.Children.Add(_FPS_TextBlock);
            Canvas.SetLeft(_FPS_TextBlock, 10);
            Canvas.SetTop(_FPS_TextBlock, 10);
            Canvas.SetZIndex(_FPS_TextBlock, 99999);
            #endregion

            #region GameLoop
            var sb = new Storyboard();
            sb.Completed += new EventHandler(sb_Completed);
            sb.Begin();
            #endregion
        }
Example #2
0
 public Floor(GameLoopHandler gl)
 {
     _h = gl;
 }
Example #3
0
 public Food(GameLoopHandler gl)
 {
     _h = gl;
 }
Example #4
0
 public Snake(GameLoopHandler gl)
 {
     _h = gl;
 }