拍摄我正在做的太空射击游戏,我想知道如何使拍摄的延迟而不是空格键感谢:)如何添加延迟到按键
public void Shoot()
{
Bullets newBullet = new Bullets(Content.Load<Texture2D>("PlayerBullet"));
newBullet.velocity = new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation)) * 5f;
newBullet.position = playerPosition + playerVelocity + newBullet.velocity * 5;
newBullet.isVisible = true;
if (bullets.Count() >= 0)
bullets.Add(newBullet);
}
仅供参考:在XNA的'Update'方法是_supposedly_称为60次第二,但它有时滞后。更新调用与“Draw”方法的调用速率完全不同,所以这会比“帧”更“打勾”。但没有什么大不了的,只是说。 – gunr2171
如果电脑速度更快的人可以更快速地拍摄,那么它就是一件大事:) –