Example #1
0
 public FlyingPigs(Tile Spawntile, int PlayerNumber, int ActiveSoldiers, int SoldiersNumber, Texture2D image, Player player)
 {
     this.owner              = player;
     this.image              = image;
     currentState            = new MouseState();
     this.tile               = Spawntile;
     this.tile.owner         = PlayerNumber;
     this.playerNumber       = PlayerNumber;
     this.activeSoldiers     = ActiveSoldiers;
     this.totalSoldiers      = SoldiersNumber;
     EventManager.OnUpdate  += Draw;
     this.transform          = this.AddComponent <Transform>();
     this.render             = this.AddComponent <UnitRenderer>();
     this.transform.Position = this.transform.Position = new Vector2((this.tile.transform.Position.X) + ((1448 * Renderer.scale) / 2) - ((image.Width * UnitRenderer.scale) / 2), (this.tile.transform.Position.Y) + ((1252 * Renderer.scale) / 2) - ((image.Height * UnitRenderer.scale) / 2));
     this.render.SetImage(image);
     this.render.start();
     this.fightManager = this.AddComponent <FightManager>();
 }
Example #2
0
        public Player(int playerNumber, int unitNumber, UnitSpawner unitSpawn, Tile tile, Texture2D image, Map map)
        {
            this.map = map;

            this.playerNumber        = playerNumber;
            this.unitNumber          = unitNumber;
            this.startTile           = tile;
            this.startTile.owner     = 10;
            this.unitSpawn           = unitSpawn;
            this.privatePlayerNumber = playerNumber;

            getStartSoldier();

            this.transform          = this.AddComponent <Transform>();
            this.unitRender         = this.AddComponent <UnitRenderer>();
            this.transform.Position = new Vector2((tile.transform.Position.X) + ((1448 * Renderer.scale) / 2) - ((image.Width * UnitRenderer.scale) / 2), (tile.transform.Position.Y) + ((1252 * Renderer.scale) / 2) - ((image.Height * UnitRenderer.scale) / 2));
            this.unitRender.SetImage(image);
            this.unitRender.start();
            EventManager.OnUpdate += OnUpdate;
        }