first tile draw
This commit is contained in:
parent
bb4a48c321
commit
d7f95860cf
2 changed files with 7 additions and 5 deletions
6
Game1.cs
6
Game1.cs
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
// using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
|
|
@ -12,8 +12,6 @@ public class Game1 : Game
|
|||
private SpriteBatch _spriteBatch;
|
||||
//
|
||||
private Map _world;
|
||||
// private Texture2D _defaultTile;
|
||||
// private const int TileSize = 32;
|
||||
|
||||
public Game1()
|
||||
{
|
||||
|
|
@ -61,6 +59,8 @@ public class Game1 : Game
|
|||
|
||||
_world.Draw(ref _spriteBatch);
|
||||
|
||||
_spriteBatch.Draw(_world._defaultTile, Vector2.Zero, Color.White);
|
||||
|
||||
_spriteBatch.End();
|
||||
//
|
||||
base.Draw(gameTime);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
// using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
// using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace tunnet.World;
|
||||
|
|
@ -11,6 +11,8 @@ struct World
|
|||
private class Tile // TODO: sprite, buildings[]
|
||||
{
|
||||
public int Id { get; }
|
||||
public Point point { get; }
|
||||
|
||||
public Tile(int id) => Id = id;
|
||||
public static Tile FromId(int id)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue