diff --git a/Shared/Player.cs b/Shared/Player.cs index 40ef2b0..24af833 100644 --- a/Shared/Player.cs +++ b/Shared/Player.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; @@ -35,8 +36,8 @@ namespace SemiColinGames { private const int swordSwingMax = 6; private float ySpeed = 0; - public Player(Texture2D texture) { - this.texture = texture; + public Player(ContentManager content) { + this.texture = content.Load("sprites/ccg/ninja_female"); } public int Facing { get; private set; } = 1; diff --git a/Shared/Scene.cs b/Shared/Scene.cs index d1d9e81..ed95aa2 100644 --- a/Shared/Scene.cs +++ b/Shared/Scene.cs @@ -18,7 +18,7 @@ namespace SemiColinGames { readonly Texture2D grasslandBg1; readonly Texture2D grasslandBg2; - public Scene(GraphicsDevice graphics, Camera camera, ContentManager content) { + public Scene(ContentManager content, GraphicsDevice graphics, Camera camera) { Enabled = false; this.graphics = graphics; this.camera = camera; diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index cf01dd8..a6a1ae6 100644 --- a/Shared/SneakGame.cs +++ b/Shared/SneakGame.cs @@ -1,9 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; - +using MonoGame.Framework.Utilities; using System; -using System.Collections.Generic; namespace SemiColinGames { public class SneakGame : Game { @@ -33,6 +32,8 @@ namespace SemiColinGames { Camera camera = new Camera(); public SneakGame() { + Debug.WriteLine("MonoGame platform: " + PlatformInfo.MonoGamePlatform + + " w/ graphics backend: " + PlatformInfo.GraphicsBackend); graphics = new GraphicsDeviceManager(this) { SynchronizeWithVerticalRetrace = true, GraphicsProfile = GraphicsProfile.HiDef @@ -69,9 +70,9 @@ namespace SemiColinGames { private void LoadLevel() { framesToSuppress = 2; camera = new Camera(); - player = new Player(Content.Load("sprites/ccg/ninja_female")); - world = new World(Content.Load("tiles/anokolisa/grassland"), Levels.ONE_ONE); - scene = new Scene(GraphicsDevice, camera, Content); + player = new Player(Content); + world = new World(Content, Levels.ONE_ONE); + scene = new Scene(Content, GraphicsDevice, camera); } // Called once per game. Unloads all game content. diff --git a/Shared/World.cs b/Shared/World.cs index 7aeeab1..9c8d28c 100644 --- a/Shared/World.cs +++ b/Shared/World.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; @@ -83,7 +84,8 @@ namespace SemiColinGames { { 'X', Terrain.Block } }; - public World(Texture2D texture, string levelSpecification) { + public World(ContentManager content, string levelSpecification) { + Texture2D texture = content.Load("tiles/anokolisa/grassland"); var tilesList = new List(); string[] worldDesc = levelSpecification.Split('\n'); tileWidth = worldDesc.AsQueryable().Max(a => a.Length);