/// <summary> /// Instantiates a new power up impl. /// </summary> /// <param name="position"> the position </param> /// <param name="veloX"> the velo X </param> /// <param name="veloY"> the velo Y </param> /// <param name="id"> the id </param> /// <param name="type"> the type </param> public PowerUpImpl(Pair <int, int> position, int veloX, int veloY, ID id, PowerUpT type) : base(position, veloX, veloY, id, type.getLifetime()) { this.type = type; this.isActiveted = false; this.Hitbox = (new Rectangle(this.Position.GetX() - WIDTH / 2, this.Position.GetY() - HEIGHT / 2, WIDTH, HEIGHT)); }
/// <summary> /// Generate velocity. /// </summary> /// <returns> the int </returns> private int generateVelocity() { Random random = new Random(); return(random.Next(PowerUpT.values().Length) + 1); }
/// <summary> /// Instantiates a new p power up. /// </summary> /// <param name="position"> the position of powerUp </param> /// <param name="veloX"> the velo X of powerUp </param> /// <param name="veloY"> the velo Y of powerUp </param> /// <param name="id"> the id of powerUp </param> /// <param name="type"> the type of powerUp </param> /// <param name="strategy"> the strategy of powerUp </param> public PPowerUp(Pair <int, int> position, int veloX, int veloY, ID id, PowerUpT type, Strategy strategy) : base(position, veloX, veloY, id, type) { this.strategy = strategy; }
/// <summary> /// The game. </summary> //private GameImpl game; /// <summary> /// Instantiates a new g power up. /// </summary> /// <param name="position"> the position of powerUp </param> /// <param name="veloX"> the velo X of powerUp </param> /// <param name="veloY"> the velo Y of powerUp </param> /// <param name="id"> the id of powerUp </param> /// <param name="type"> the type of powerUp </param> public GPowerUp(Pair <int, int> position, int veloX, int veloY, ID id, PowerUpT type) : base(position, veloX, veloY, id, type) { }