public void FeatherFire() { if (feather == null) { return; } Beam b = (Beam)GetBeam(feather.BeamSpawnLocation(), feather.Orientation); Matrix Orientation = feather.Orientation; physicsManager.AddNewObject((Entity)b); b.Orientation = Orientation; b.SetForwardSpeed(); }
public void FeatherFire() { if (feather == null) { return; } long currentTime = DateTime.UtcNow.Ticks; if (lastFire + (10000 * 200) > currentTime) // 10000 ticks in a milisecond, fire every 10 miliseconds (10 times a second) { return; } lastFire = currentTime; Beam b = (Beam)GetBeam(feather.BeamSpawnLocation(), feather.Orientation); Matrix Orientation = feather.Orientation; physicsManager.AddNewObject((Entity)b); b.Orientation = Orientation; b.SetForwardSpeed(); }