Example #1
0
        public SpriteBatch spriteBatch; //not used and can probably remove soon, but leave for now, this is all just default xna code. I offloaded this to a seperate class.

        public Main()
        {
            graphics = new GraphicsDeviceManager(this); //Resolution must be 4:3 or tiles wont be square, this is easy to fix but it makes more sense to just lock the res options honestly.
            graphics.IsFullScreen = false;              //not all screens are 4:3, and not enabling full screen totally presents that moonrune rpgmaker aesthetic we all know and love
            graphics.PreferredBackBufferHeight = 600;
            graphics.PreferredBackBufferWidth  = 800;
            MapHandling.setTileSize();
            Content.RootDirectory = "Content";  //not used, we can probably remove soon, but leave for now, this is all just default xna code. Offloaded to ImageLoader.cs
        }
Example #2
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)
        {
            // TODO: Gameloop
            SceneHandling.handleScene();  //the individual gameloops for the different menus etc should go in their own section of processScene()
            InputHandling.setInputState();
            if (MapHandling.reDraw && SceneHandling.currentScene == SceneHandling.Scenes.Ingame)
            {
                MapHandling.layoutTiles();
            }



            base.Update(gameTime);
        }
Example #3
0
 public void setResolution(ResolutionOptions newResolution)
 {
     if (newResolution == ResolutionOptions.SMALL)
     {
         x = 800;
         y = 600;
     }
     else if (newResolution == ResolutionOptions.MEDIUM)
     {
         x = 1024;
         y = 768;
     }
     else //LARGE
     {
         x = 1280;
         y = 960;
     }
     Main.graphics.PreferredBackBufferHeight = y;
     Main.graphics.PreferredBackBufferWidth  = x;
     Main.graphics.ApplyChanges();
     MapHandling.refreshSize();  //update tiles
 }
Example #4
0
 static public void updateStep()
 {
     STEP = MapHandling.getTileLength();
 }