Пример #1
0
        //Constructor
        public MapGrid(Game game, int tile_width, int tile_height, int[,] tilemap, List <Texture2D> textureList)
        {
            game.Services.AddService(this);
            spriteBatch = game.Services.GetService <SpriteBatch>();
            bc          = game.Services.GetService <BattleController>();
            MyGame      = game;
            TileWidth   = tile_width;
            TileHeight  = tile_height;
            TileMap     = tilemap;
            textures    = textureList;
            tilesList   = new List <Tile>();

            SetMap();
        }
Пример #2
0
 public Character(Game game, int health, int magicPoints, int teamNum, Element elementType, Texture2D texture, Vector2 userPosition, int frameCount, OriginType origin) : base(game, texture, userPosition, frameCount, origin)
 {
     grid          = game.Services.GetService <MapGrid>();
     sp            = game.Services.GetService <SpriteBatch>();
     bController   = game.Services.GetService <BattleController>();
     Health        = health;
     MagicPoints   = magicPoints;
     ClickBox      = CollisionField;
     ElementalType = elementType;
     gridCell      = new int[] { (int)userPosition.X / 64, (int)userPosition.Y / 64 };
     MovementRange = 3;
     AttackRange   = 1;
     Visible       = true;
     teamNumber    = teamNum;
 }