Example #1
0
        public virtual void Launch(GameVelocity velocity, double lifeTime, IProjectileDelegate @delegate)
        {
            this.startTime  = GameTime.Time;
            this.isLaunched = true;
            this.lifeTime   = lifeTime;
            this.Delegate   = @delegate;

            if (this.PhysicsNode != null && this.PhysicsBody != null)
            {
                this.PhysicsBody.VelocityFactor        = SCNVector3.One;
                this.PhysicsBody.AngularVelocityFactor = SCNVector3.One;
                this.PhysicsBody.Velocity      = velocity.Vector;
                this.PhysicsNode.Name          = "ball";
                this.PhysicsNode.WorldPosition = velocity.Origin;
                this.PhysicsBody.ResetTransform();
            }
            else
            {
                throw new System.Exception("Projectile not setup");
            }
        }
Example #2
0
 public override void Launch(GameVelocity velocity, double lifeTime, IProjectileDelegate @delegate)
 {
     base.Launch(velocity, lifeTime, @delegate);
     this.AddTrail();
 }