Beispiel #1
0
        //we know address of the target object that will trigger the zone
        public ZoneObject(string id, ActorType actorType, Transform3D transform,
                          bool isImpenetrable, EventParameters eventParameters, IActor targetActor)
            : base(id, actorType, transform, Color.White, 1)
        {
            //set body and skin for this zone
            this.body = new Body();
            this.body.ExternalData  = this;
            this.collision          = new CollisionSkin(this.body);
            this.body.CollisionSkin = this.collision;

            this.targetActor     = targetActor;
            this.isImpenetrable  = isImpenetrable; //we cant move through it
            this.eventParameters = eventParameters;

            //register method to handle collisions
            this.collision.callbackFn += HandleCollision;
        }
Beispiel #2
0
 //we know address of the target object that will trigger the zone
 public CameraZoneObject(string id, ActorType actorType, Transform3D transform,
                         bool isImpenetrable, EventParameters eventParameters, IActor targetActor)
     : base(id, actorType, transform, isImpenetrable, eventParameters, targetActor)
 {
 }
 public PickupCollidableObject(string id, ActorType actorType, Transform3D transform, BasicEffect effect,
                               Color color, float alpha, Texture2D texture, Model model, EventParameters eventParameters)
     : base(id, actorType, transform, effect, color, alpha, texture, model)
 {
     this.eventParameters = eventParameters;
 }
Beispiel #4
0
 //no target specified e.g. we detect by object type not specific target address
 public ZoneObject(string id, ActorType actorType,
                   Transform3D transform, bool isImpenetrable, EventParameters eventParameters)
     : this(id, actorType, transform, isImpenetrable, eventParameters, null)
 {
 }