Пример #1
0
        /// <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);
        }
Пример #2
0
 public static TPEngine Get()
 {
     if (m_Singleton == null)
     {
         m_Singleton = new TPEngine();
     }
     return m_Singleton;
 }
Пример #3
0
 public static TPEngine Get()
 {
     if (m_Singleton == null)
     {
         m_Singleton = new TPEngine();
     }
     return(m_Singleton);
 }
Пример #4
0
        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;
        }
Пример #5
0
 public static float GetRandomMirrorRange(float val)
 {
     return((float)(((TPEngine.Get().Rand.NextDouble() * val) * 2) - (TPEngine.Get().Rand.NextDouble() * val)));
 }
Пример #6
0
 /// <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);
 }
Пример #7
0
 /// <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);
 }