public GameManager(XmasHell game) { _game = game; _bullets = new List <Bullet>(); _lasers = new List <Laser>(); _endGame = false; MoverManager = new MoverManager(_game); CollisionWorld = new CollisionWorld(_game); ParticleManager = new ParticleManager(_game); //Random = new Random(GameConfig.RandomSeed); Random = new Random(); _cameraZoomTimer = new CountdownTimer(GameConfig.EndGameCameraZoomTime); _cameraZoomTimer.Stop(); _cameraZoomTimer.Completed += CameraZoomTimerCompleted; _explosionTimer = new CountdownTimer(GameConfig.EndGameExplosionTime); _explosionTimer.Stop(); _explosionTimer.Completed += ExplosionTimerCompleted; _transitioningToEndGame = false; _cantMove = false; }
public Camera(XmasHell game, GraphicsDevice graphicsDevice) : base(graphicsDevice) { _game = game; _targetingZoom = false; _targetZoom = 1f; _followPositionDelegate = null; _followingPosition = false; }
public Camera(XmasHell game, ViewportAdapter viewportAdapter) : base(viewportAdapter) { _game = game; _targetingZoom = false; _targetZoom = 1f; _followPositionDelegate = null; _followingPosition = false; MaximumZoom = 5f; MinimumZoom = 0.01f; }
public GameManager(XmasHell game) { _game = game; _bullets = new List <Bullet>(); _lasers = new List <Laser>(); _endGame = false; MoverManager = new MoverManager(_game); CollisionWorld = new CollisionWorld(_game); ParticleManager = new ParticleManager(_game); //Random = new Random(GameConfig.RandomSeed); Random = new Random(); _endGameTimer = new CountdownTimer(1); _endGameTimer.Stop(); _endGameTimer.Completed += EndGameTimerCompleted; _endGameFirstTime = true; }
private static Dictionary <string, CustomSpriterAnimator> LoadSpriterFile(ContentManager content, string filename) { var factory = new DefaultProviderFactory <ISprite, SoundEffect>(DefaultAnimatorConfig, true); var loader = new SpriterContentLoader(content, filename); loader.Fill(factory); var animators = new Dictionary <string, CustomSpriterAnimator>(); foreach (var entity in loader.Spriter.Entities) { var animator = new CustomSpriterAnimator(entity, factory); // Center the animator animator.Position = XmasHell.Instance().ViewportAdapter.Center.ToVector2(); animators.Add(entity.Name, animator); } return(animators); }
public XmasHell() #endif { _instance = this; Graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; #if ANDROID Graphics.SupportedOrientations = DisplayOrientation.Portrait; AndroidActivity = activity; // Used for bloom effect Graphics.PreferredDepthStencilFormat = DepthFormat.Depth16; Graphics.IsFullScreen = true; Graphics.ApplyChanges(); #else Graphics.IsFullScreen = false; Window.AllowUserResizing = true; IsMouseVisible = true; //Graphics.PreferredBackBufferWidth = GameConfig.VirtualResolution.X; //Graphics.PreferredBackBufferHeight = GameConfig.VirtualResolution.Y; Graphics.PreferredBackBufferWidth = 480; Graphics.PreferredBackBufferHeight = 853; // Unlock FPS //IsFixedTimeStep = false; //Graphics.SynchronizeWithVerticalRetrace = false; #endif GameManager = new GameManager(this); SpriteBatchManager = new SpriteBatchManager(this); PerformanceManager = new PerformanceManager(this); CloudManager = new CloudManager(this); }