public static void Init(List <Player> players) { guiScores = new Dictionary <Player, GuiNumber>(); guiPowerUps = new Dictionary <Player, List <GUIItem> >(); for (int i = 0; i < players.Count; i++) { Player currPlayer = players[i]; GUIItem guiImage = new GUIItem(currPlayer.GUIPosition, currPlayer.GUIImage); Vector2 scorePosition = guiImage.Position + new Vector2(0, guiImage.Height / 2) + new Vector2(-2, 2); guiScores[currPlayer] = new GuiNumber(scorePosition, "0000000"); guiPowerUps[currPlayer] = new List <GUIItem>(); int numPowerUps = Enum.GetValues(typeof(PowerUpType)).Length; Vector2 offset = new Vector2(0, 1); for (int j = 0; j < numPowerUps; j++) { PowerUpType type = (PowerUpType)j; GUIItem g = new PowerUpGUIItem(scorePosition + offset, type); guiPowerUps[currPlayer].Add(g); offset += new Vector2(1, 0); } } }
public override void Enter() { base.Enter(); timeCountdown = 3.4f; guiNumber = new GuiNumber(new Vector2(Game.Window.OrthoWidth / 2, Game.Window.OrthoHeight / 2), Convert.ToInt16(timeCountdown).ToString()); guiNumber.Scale *= 2; audioSource = new AudioSource(); clipCountDown = AudioManager.GetAudioClip("countdown"); audioSource.Play(clipCountDown, true); }
private void OnDie() { IsActive = false; GuiNumber guiNumber = new GuiNumber(Position, scoreOnHitted.ToString()); guiNumber.Dissolve = true; guiNumber.Scale *= 0.4f; new DisappearEnemyEffect(Position); EnemyCount--; Destroy(); }
void IPickable.OnPlayerPick(Player p) { if (!isPicked) { IsActive = false; isPicked = true; GuiNumber guiNumber = new GuiNumber(Position, score.ToString()); guiNumber.Dissolve = true; guiNumber.Scale *= 0.4f; audioSource.Play(clipOnPicked); p.AddScore(score); } }
int IHittable.OnHit(GameObject hitter) { IsActive = false; isHitted = true; RigidBody.IsCollisionsAffected = false; GuiNumber guiNumber = new GuiNumber(Position, SCORE_ON_HITTED.ToString()); guiNumber.Dissolve = true; guiNumber.Scale *= 0.4f; new FireBurn(Position).Play(); PlayScene.Map.SetCost(Position, 1); PlayScene.FreePositions.Add(Position); Destroy(); return(SCORE_ON_HITTED); }