public static void ServerInitialize(Bullet obj, Ship owner, Vector2 position, float direction) { MovingGameObject.ServerInitialize(obj, position, Utils.Vector2Utils.ConstructVectorFromPolar(speed, direction) /*+ owner.Velocity*/, direction, 0, direction); obj.owner.Value = owner; obj.start.Value = position; }
public override void ServerOnlyUpdate(float seconds) { base.ServerOnlyUpdate(seconds); if (this.fire && this.CooldownTimer <= 0) { this.CooldownTimer = COOLDOWN_TIME; //FIRE Bullet b = new Bullet(this.Game); Bullet.ServerInitialize(b, (Ship)(this.Root()), this.WorldPosition(), this.WorldDirection()); this.Game.GameObjectCollection.Add(b); } this.fire = false; }