private void releaseItem(Device device) { var player = (Player)ActiveMap.Player; var mdir = new Vector2((float)Math.Cos(player.Rotation + Math.PI / 2), (float)Math.Sin(player.Rotation + Math.PI / 2)); var launchPort = player.Position + mdir * (player.Radius + 5); //launch stuff from slightly in front of player float launchVel = 300f + player.Velocity.Length(); var carrier = new DeviceTransporter(launchPort, 15); carrier.Velocity = launchVel * mdir; carrier.AddDevice(device); SpawnObject<Actor>(carrier); SpawnObject<Device>(device); }
public override void AddDevice(Device d) { base.AddDevice(d); d.Suppressed = true; }
public virtual void AddDevice(Device d) { d.Parent = this; _devices.Add(d); }