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 }
public Floor(GameLoopHandler gl) { _h = gl; }
public Food(GameLoopHandler gl) { _h = gl; }
public Snake(GameLoopHandler gl) { _h = gl; }