public void ChangeCharacter(Character c) { if (SelectedCharacter != null) { if (SelectedCharacter.weapon != Character.Weapon.None) { weaponIcons[SelectedCharacter.weapon].CurrentFrame = 1; } } SelectedCharacter = c; healthbar = new Healthbar(ArtAssets.Healthbar, SelectedCharacter.maxHP, SelectedCharacter.hp, Vector2.Zero); healthbar.Center = HealthBarPosition; stepCount.CurrentFrame = SelectedCharacter.move; if (SelectedCharacter.animation.Position != AnimationPosition) { SelectedCharacter.animation.Position = AnimationPosition; } SelectedCharacter.animation.Scale = Globals.ANIMATION_SCALE; if (SelectedCharacter.weapon != Character.Weapon.None) { weaponIcons[c.weapon].CurrentFrame = 2; } rankName.CurrentFrame = rankNameFrames[SelectedCharacter.rank]; }
private void SetHealthBar(int hp) { healthbar = new Healthbar(ArtAssets.Healthbar, hp); healthbar.Center = HealthBarPosition; }