public void setUpUnit(int x, int y, Bitmap a, String b) { this.x = x; this.y = y; this.unitType = Globals.UnitType.Player; this.unitImage = a; this.deadUnitImage = b; this.returnImage = this.unitImage; offset = new Random().Next(8); }
public Corpse CreateCorpse(int x, int y, Globals.UnitType ut = Globals.UnitType.Devil, String backupDeathImage = null) { if (corpseOnCell == null) { if (ut == Globals.UnitType.Player) { this.corpseOnCell = new Corpse(backupDeathImage, 400); } else { this.corpseOnCell = new Corpse("Resources/Images/Enemy/" + ut + "/" + ut + "_Death.png", 400); } } return(this.corpseOnCell); }
public Unit CreateUnit(int x, int y, int id, Globals.UnitType ut = Globals.UnitType.Devil, String backupImage = null) { this.isUnitOnCell = true; if (ut == Globals.UnitType.Player) { this.unitOnCell = new Unit(backupImage); this.unitOnCell.setUpUnit(x, y, ut, true, id); } else { this.unitOnCell = new Unit("Resources/Images/Enemy/" + ut + "/" + ut + "_Idle.png"); this.unitOnCell.setUpUnit(x, y, ut, false, id); } return(this.unitOnCell); }
/// <summary> /// setUpUnit is a constructor but like later /// </summary> /// <param name="unitImage">Provides a bitmap image to be read whenever the unit is 'alive'</param> /// <param name="deadUnitImage">Provides a bitmap image to be read/drawn wheenever the unit is 'dead'</param> public void setUpUnit(int x, int y, Globals.UnitType enemyType, bool friendly, int id) { this.x = x; this.y = y; this.unitType = enemyType; this.id = id; if (unitType == Globals.UnitType.Player) { friendly = true; } if (friendly) { this.unitImage = (Bitmap)Image.FromFile(m); this.deadUnitImage = m; } else { this.unitImage = (Bitmap)Image.FromFile("Resources/Images/Enemy/" + enemyType + "/" + enemyType + "_Idle.png"); this.deadUnitImage = "Resources/Images/Enemy/" + enemyType + "/" + enemyType + "_Death.png"; } this.returnImage = this.unitImage; offset = new Random().Next(8); }