diff --git a/Shared/Debug.cs b/Shared/Debug.cs index bf8927c..22e3663 100644 --- a/Shared/Debug.cs +++ b/Shared/Debug.cs @@ -45,7 +45,6 @@ namespace SemiColinGames { } public static void DrawToast(SpriteBatch spriteBatch, SpriteFont font) { - // TODO: this use of toast isn't thread-safe. if (toast == null) { return; } diff --git a/Shared/Player.cs b/Shared/Player.cs index d88b245..22aab65 100644 --- a/Shared/Player.cs +++ b/Shared/Player.cs @@ -45,10 +45,7 @@ namespace SemiColinGames { Rectangle oldBbox = Bbox(oldPosition); Rectangle playerBbox = Bbox(position); bool standingOnGround = false; - // TODO: implement https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm - // e.g. http://members.chello.at/~easyfilter/bresenham.html - // TODO: currently player doesn't fall through a gap one tile wide; presumably this will - // be fixed by switching to a line-rasterization approach. + foreach (var rect in collisionTargets) { playerBbox = Bbox(position); @@ -100,9 +97,6 @@ namespace SemiColinGames { } } - // TODO: refactor input to have a virtual "which directions & buttons were being pressed" - // instead of complicated if-statements in this function. - // TODO: refactor to use a state-machine. void UpdateFromInput( GameTime time, History gamePad, History keyboard) { if ((gamePad[0].IsButtonDown(Buttons.A) && gamePad[1].IsButtonUp(Buttons.A) || @@ -124,8 +118,6 @@ namespace SemiColinGames { } Vector2 leftStick = gamePad[0].ThumbSticks.Left; - // TODO: have keyboard directions cancel each other out if mutually-incompatible keys are - // held down? if (gamePad[0].IsButtonDown(Buttons.DPadLeft) || leftStick.X < -0.5 || keyboard[0].IsKeyDown(Keys.A)) { facing = Facing.Left; @@ -162,7 +154,6 @@ namespace SemiColinGames { pose = Pose.Jumping; } - // TODO: also bound player position by the right edge of the World? position.X = Math.Max(position.X, 0 + spriteWidth); } @@ -201,7 +192,6 @@ namespace SemiColinGames { } public void Draw(SpriteBatch spriteBatch, Camera camera, GameTime time) { - // TODO: don't create so many "new" things that could be cached / precomputed. int index = spritePosition(pose, time); Rectangle textureSource = new Rectangle(index * spriteSize, 0, spriteSize, spriteSize); Vector2 spriteCenter = new Vector2(spriteSize / 2, spriteSize / 2); diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index 828e3db..7f80cee 100644 --- a/Shared/SneakGame.cs +++ b/Shared/SneakGame.cs @@ -51,17 +51,15 @@ namespace SemiColinGames { protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load("font"); - // TODO: decouple things like Player and World from their textures. + player = new Player(Content.Load("player_1x")); world = new World(Content.Load("grassland")); - // TODO: move backgrounds into World. grasslandBg1 = Content.Load("grassland_bg1"); grasslandBg2 = Content.Load("grassland_bg2"); } // Called once per game. Unloads all game content. protected override void UnloadContent() { - // TODO: Unload any non ContentManager content here. } // Updates the game world. diff --git a/Shared/World.cs b/Shared/World.cs index 3f24cf6..6220462 100644 --- a/Shared/World.cs +++ b/Shared/World.cs @@ -35,7 +35,6 @@ namespace SemiColinGames { Vector2 drawPos = new Vector2(position.Left - camera.Left, position.Top); switch (terrain) { case Terrain.Grass: { - // TODO: hold these rectangles statically instead of making them anew constantly. Rectangle source = new Rectangle(3 * size, 0 * size, size, size); spriteBatch.Draw(texture, drawPos, source, Color.White); break; @@ -112,7 +111,6 @@ namespace SemiColinGames { "...................................................................] [.............] [..............................................................] [......................................................." }; public World(Texture2D texture) { - // TODO: better error handling for if the string[] isn't rectangular. width = worldDesc[0].Length; height = worldDesc.Length; tiles = new Tile[width, height];