Ejemplo n.º 1
0
        public static Trigger CreateTrigger(Vector2 position, Texture2D enemyTexture, List <IGameObject> door)
        {
            var triggerSprite = new Sprite(enemyTexture, 58, 80);

            triggerSprite.CreateAnimmtion("idle", (0, 0));
            triggerSprite.PlayAnimation("idle");
            triggerSprite.CreateAnimmtion("switch", (1, 0));

            var triggerPhysics = new Physics();

            triggerPhysics.EntityBoundingBoxType = Physics.BoundingBoxType.AABB;
            triggerPhysics.EntityPhysicsType     = Physics.PhysicsType.STATICS;
            triggerPhysics.EntityImpluseType     = Physics.ImpluseType.SURFACE;

            var trigger = new Trigger();

            trigger.AddComponent(triggerSprite);
            trigger.AddComponent(triggerPhysics);
            trigger.transform.position = position;
            trigger.Name     = "trigger";
            trigger.doorList = door;

            return(trigger);
        }