Example #1
0
 public void FireChargeBullet()
 {
     if (Engine.Keyboard.GetKeyState(Key.N) == ButtonState.Hold)
     {
         chargeTime += 0.2f;
         chargeTime  = Math.Clamp(chargeTime, 0.0f, 60.0f);
     }
     if (Engine.Keyboard.GetKeyState(Key.I) == ButtonState.Push && chargeTime > 0.0f)
     {
         PlayerBullet playerBullet = new PlayerBullet(_mainNode, new Vector2F(Position.X + Texture.Size.X + 10.0f, Position.Y + Texture.Size.Y / 2.0f), new Vector2F(10.0f, 0.0f), this, chargeTime);
         playerBullet.Scale = new Vector2F(chargeTime, chargeTime);
         Engine.AddNode(playerBullet);
         chargeTime = 0.0f;
     }
 }