public void ApplyPowerup(Powerup powerup) { playerPowerup = powerup; Debug.Log("Accepted" + powerup.type + "."); powerup.ActivatePowerup(); ResetPowerup(); if (playerPowerup.type == Modifier.INVINCIBLE) { isInvincible = true; Debug.Log("now invincible"); hasPowerup = true; } else if (playerPowerup.type == Modifier.JUMPHEIGHT) { isDoubleJump = true; Jump(); } else if (playerPowerup.type == Modifier.SPEED) { isFast = true; // Temp double player speed. Movement(20, 0); hasPowerup = true; } Debug.Log("powerup deactivated"); }
private void RemoveActiveWord(Word active) { activeWord.Remove(active); // Active the powerup for that word powerupController.ActivatePowerup(active.lineNumFunction, active); // pass the index ScoreController.incrementScore(active.points); // Get points for typing the word correctly active.display.RemoveWord(); wordList.Remove(active); }