/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { base.LoadContent(); spriteBatch = new SpriteBatch(GraphicsDevice); TPEngine.Get().Initialize(this); }
public static TPEngine Get() { if (m_Singleton == null) { m_Singleton = new TPEngine(); } return m_Singleton; }
public static TPEngine Get() { if (m_Singleton == null) { m_Singleton = new TPEngine(); } return(m_Singleton); }
public TPGame() : base() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; int screenWidth = 1280; int screenHeight = 720; TPEngine.Get().ScreenSize.Width = screenWidth; TPEngine.Get().ScreenSize.Height = screenHeight; graphics.PreferredBackBufferHeight = screenHeight; graphics.PreferredBackBufferWidth = screenWidth; }
public static float GetRandomMirrorRange(float val) { return((float)(((TPEngine.Get().Rand.NextDouble() * val) * 2) - (TPEngine.Get().Rand.NextDouble() * val))); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { base.Draw(gameTime); TPEngine.Get().State.Draw(spriteBatch); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { base.Update(gameTime); TPEngine.Get().Update(gameTime); }