struct Bullet { public Vector3 position; public Vector3 direction; public float speed; public bool isActive; public void Update(float delta) { position += direction * speed * GameConstants.BulletSpeedAdjustment * delta; if (position.X > GameConstants.PlayfieldSizeX || position.X < -GameConstants.PlayfieldSizeX || position.Y > GameConstants.PlayfieldSizeY || position.Y < -GameConstants.PlayfieldSizeY) isActive = false; } }
You need to enable Javascript in your browser to edit pages.
help on how to format text
Code for Bullet.cs