public static void Load() { _tickables = null; _removables = null; _addables = null; loadNewBehaviour = new Time(); loadNewBehaviour = player = newPlayer; loadNewBehaviour = new PlayerUI(); loadNewBehaviour = new PowerupUI(); gameScroller = new GameScroller(); gameXLocation = 0; currentLevel.load(); //FieldPartContainer.generateFieldParts(); game.gameTimer.Start(); Console.WriteLine("load"); foreach (IBehaviour b in tickables) { b.onLoad(); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { // After everything has loaded, rendered and so on Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, new Action(() => { lstSprites.ItemsSource = ThisLevel.Sprites; Scroller = new GameScroller(GameSlider, MainGFX, GameWrapper); MainGFX.Start(); })); }