Beispiel #1
0
 public FlyingPhysicsComponent(IEntity owner, PhysicsData data)
     : base(owner)
 {
     this.position = owner.getVectorProperty(EntityProperty.Position);
     this.data = data;
     initialize();
 }
Beispiel #2
0
        public override void LoadContent()
        {
            base.LoadContent();

            List<CollisionBody> bodyList = new List<CollisionBody>();
            int i = 0;
            // poligonos de arriba
            List<Vector2> polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 2, blockSize * 7), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 4, blockSize * 2), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 7, blockSize * 2), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 3, GameConstants.CAMERA_INNER_BORDER + blockSize * 3));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 3, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 9, blockSize * 3), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 12, blockSize * 5), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 15, blockSize * 5), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize * 4));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 4, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 21, blockSize * 2), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 26, blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 29, blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 33, blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 38, blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 48, blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 3, GameConstants.CAMERA_INNER_BORDER + blockSize * 3));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 3, GameConstants.CAMERA_INNER_BORDER + 0));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 59, blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            // poligonos de abajo
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 4, blockSize * 12), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize * 2));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 2, GameConstants.CAMERA_INNER_BORDER + blockSize * 2));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 6, blockSize * 13), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 10, blockSize * 14), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 22, blockSize * 14), false, GameLayers.MIDDLE_PLAY_AREA));
            polyPoints = new List<Vector2>();
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + 0));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize, GameConstants.CAMERA_INNER_BORDER + blockSize));
            polyPoints.Add(new Vector2(GameConstants.CAMERA_INNER_BORDER + 0, GameConstants.CAMERA_INNER_BORDER + blockSize));
            bodyList.Add(ShapeFactory.CreatePolygon("Polygon" + ++i, this, true, false, polyPoints, new Vector2(blockSize * 58, blockSize * 12), false, GameLayers.MIDDLE_PLAY_AREA));
            i = 0;
            // bloques de arriba
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 2, blockSize * 8, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 0, GameConstants.CAMERA_INNER_BORDER + blockSize * 0), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 2, blockSize * 3, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 2, GameConstants.CAMERA_INNER_BORDER + blockSize * 0), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 1, blockSize * 4, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 2, GameConstants.CAMERA_INNER_BORDER + blockSize * 3), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 8, blockSize * 2, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 4, GameConstants.CAMERA_INNER_BORDER + blockSize * 0), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 4, blockSize, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 8, GameConstants.CAMERA_INNER_BORDER + blockSize * 2), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 5, blockSize, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 16, GameConstants.CAMERA_INNER_BORDER + blockSize * 5), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 5, blockSize * 2, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 21, GameConstants.CAMERA_INNER_BORDER + blockSize * 0), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 38, blockSize * 1, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 26, GameConstants.CAMERA_INNER_BORDER + blockSize * 0), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 3, blockSize * 1, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 30, GameConstants.CAMERA_INNER_BORDER + blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 9, blockSize * 1, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 39, GameConstants.CAMERA_INNER_BORDER + blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            bodyList.Add(ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 2, blockSize * 3, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 62, GameConstants.CAMERA_INNER_BORDER + blockSize * 1), false, GameLayers.MIDDLE_PLAY_AREA));
            // bloques de abajo
            List<AreaCollisionBodyWrapper> bodyWrapperList = new List<AreaCollisionBodyWrapper>();
            AreaCollisionBodyWrapper wrapper = null;
            wrapper = new AreaCollisionBodyWrapper(this, ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 4, blockSize * 4, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 0, GameConstants.CAMERA_INNER_BORDER + blockSize * 12), false, GameLayers.MIDDLE_PLAY_AREA));
            wrapper.addBoolProperty(EntityProperty.Earth, true);
            bodyWrapperList.Add(wrapper);
            wrapper = new AreaCollisionBodyWrapper(this, ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 2, blockSize * 3, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 4, GameConstants.CAMERA_INNER_BORDER + blockSize * 13), false, GameLayers.MIDDLE_PLAY_AREA));
            wrapper.addBoolProperty(EntityProperty.Earth, true);
            bodyWrapperList.Add(wrapper);
            wrapper = new AreaCollisionBodyWrapper(this, ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 5, blockSize, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 6, GameConstants.CAMERA_INNER_BORDER + blockSize * 15), false, GameLayers.MIDDLE_PLAY_AREA));
            wrapper.addBoolProperty(EntityProperty.Earth, true);
            bodyWrapperList.Add(wrapper);
            wrapper = new AreaCollisionBodyWrapper(this, ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 11, blockSize * 2, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 11, GameConstants.CAMERA_INNER_BORDER + blockSize * 14), false, GameLayers.MIDDLE_PLAY_AREA));
            wrapper.addBoolProperty(EntityProperty.Earth, true);
            bodyWrapperList.Add(wrapper);
            wrapper = new AreaCollisionBodyWrapper(this, ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 36, blockSize, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 22, GameConstants.CAMERA_INNER_BORDER + blockSize * 15), false, GameLayers.MIDDLE_PLAY_AREA));
            wrapper.addBoolProperty(EntityProperty.Earth, true);
            bodyWrapperList.Add(wrapper);
            wrapper = new AreaCollisionBodyWrapper(this, ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize, blockSize * 3, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 58, GameConstants.CAMERA_INNER_BORDER + blockSize * 13), false, GameLayers.MIDDLE_PLAY_AREA));
            wrapper.addBoolProperty(EntityProperty.Earth, true);
            bodyWrapperList.Add(wrapper);
            wrapper = new AreaCollisionBodyWrapper(this, ShapeFactory.CreateRectangle("Block" + ++i, this, true, false, blockSize * 5, blockSize * 4, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 59, GameConstants.CAMERA_INNER_BORDER + blockSize * 12), false, GameLayers.MIDDLE_PLAY_AREA));
            wrapper.addBoolProperty(EntityProperty.Earth, true);
            bodyWrapperList.Add(wrapper);
            CollisionComponent.addBodies(bodyList);
            CollisionComponent.addWrappers(bodyWrapperList);
            EventManager.Instance.addCollisionListener(this, new SurfaceCollisionResponse(this));

            PhysicsData boxPhysics = new PhysicsData();
            boxPhysics.MinimumVelocity = new Vector2(-500, -5000);
            boxPhysics.MaximumVelocity = new Vector2(500, 2000);
            boxPhysics.Weight = 15;
            boxPhysics.RunningImpulse = 30000;
            boxPhysics.AirImpulse = 15000;
            boxPhysics.JumpImpulse = 1200000;

            Dictionary<ElementType, float> boxElementMultipliers =
                UtilMethods.getDamageMultipliers(DamageMultipliers.NORMAL_DAMAGE, DamageMultipliers.HIGH_DAMAGE,
                DamageMultipliers.NORMAL_DAMAGE, DamageMultipliers.NORMAL_DAMAGE, DamageMultipliers.NORMAL_DAMAGE);

            // Conjunto de bloques que desaparecen visualmente cuando
            // se activa un trigger
            DrawableEntity fadeWall = new DrawableEntity();
            fadeWall.addDrawEffect(new FadeEffect(fadeWall, 0.02f, 0.4f, 1.0f));

            // Trigger utilizado para desaparecer
            // visualmente una entidad cuando se entra
            // en el rango del trigger
            BaseTrigger baseTrigger = new BaseTrigger();
            Box cameraTriggerBody = ShapeFactory.CreateRectangle("trigger", baseTrigger, false, false, blockSize * 9, blockSize * 5, new Vector2(GameConstants.CAMERA_INNER_BORDER + blockSize * 12, GameConstants.CAMERA_INNER_BORDER + blockSize * 0), false);
            baseTrigger.Zone = cameraTriggerBody;
            FadeInTrigger ct = new FadeInTrigger(baseTrigger, fadeWall);
            this.areaItems.Add(baseTrigger);
        }
Beispiel #3
0
        /// <summary>
        /// Carga inicial despues de haber construido el objeto, solo debe hacerse una vez
        /// </summary>
        public void LoadContent()
        {
            if (hasLoaded == false)
            {
                // Aquí inicializo todo lo referente a la entidad principal ya que aún no se donde ponerlo
                DrawableEntity goemon = new DrawableEntity(GlobalIDs.MAIN_CHARACTER_ID);
                this.mainEntity = goemon;
                goemon.Position = new Vector2(175 + 100, 200 + 200);
                //HERE DEADEVENT SE DEBERÏA MOVER PERO SI NO PRODUCE BUG
                //el orden de creación de los componentes influye en el orden en que se envían los eventos
                goemon.addComponent(new DeadComponent(goemon));

                /************** Inicialización animación Goemon **********/
                Animation runningAnimation = new Animation(ActionsList.Running, 30, 38, 8, 40, 9, new Vector2(3.84f, 5f), 0, 0);
                runningAnimation.addAllDefaultFrames(6);
                Animation attackAnimation = new Animation(ActionsList.Attack, 55, 52, 5, 4, 185, new Vector2(3.84f, 5f), 10, 10);
                attackAnimation.addAllDefaultFrames(2);
                attackAnimation.addFrame(new AnimationFrame(new Rectangle(110, 185, 48, 52), 5, null, new Vector2(3.84f, 5f), 10, 10));
                attackAnimation.addFrame(new AnimationFrame(new Rectangle(162, 185, 55, 52), 5, null, new Vector2(3.84f, 5f), -10, 10));
                attackAnimation.addFrame(new AnimationFrame(new Rectangle(220, 185, 55, 52), 5,
                    "Rectangle TestBody False 180 70 0 -20 False;FeInwork.collision.responses.SingleHitCollisionResponse!TestBody;10",
                    new Vector2(3.84f, 5f), -10, 10));

                Animation deadAnimation = new Animation(ActionsList.Dead, 76, 78, 6, 192, 577, new Vector2(1.7f, 1.7f));
                deadAnimation.addAllDefaultFrames(4);
                Animation stillAnimation = new Animation(ActionsList.Default, 28, 34, 60, 315, 10, new Vector2(3.84f, 5f), 0, 0);
                stillAnimation.addAllDefaultFrames(4);

                //Todas las animiaciones se deben agregar al animation manager que necesita una por defecto
                AnimationManagerComponent animationManager = new AnimationManagerComponent(goemon, new AliveAttackerActionChooser(goemon), stillAnimation);
                animationManager.addAction(attackAnimation);
                animationManager.addAction(runningAnimation);
                animationManager.addAction(deadAnimation);
                /************** FIN de Inicialización animación Goemon **********/

                // Efectos de dibujo a aplicarle al personaje principal
                goemon.addDrawEffect(new HaloEffect(goemon));
                goemon.addDrawEffect(new FadeEffect(goemon, 0.02f, 0.4f, 1.0f));
                goemon.addComponent(new AnimationRenderer(goemon, AssetNames.GOEMON_ASSET, animationManager, 5, 5));

                goemon.addComponent(new ControlComponent(goemon));
                goemon.addComponent(new PhysicalAttackComponent(goemon, 10));
                goemon.addComponent(new SpecialActionManagerComponent(goemon));
                HealthComponent hp = new HealthComponent(goemon, null, 100, 70, 120);
                goemon.addComponent(hp);
                //goemon.addComponent(new HealthRenderer(goemon, hp, 10, 10));

                PhysicsData goemonPhysics = new PhysicsData();
                goemonPhysics.MinimumVelocity = new Vector2(-500, -5000);
                goemonPhysics.MaximumVelocity = new Vector2(500, 2000);
                goemonPhysics.Weight = 20;
                goemonPhysics.RunningImpulse = 30000;
                goemonPhysics.AirImpulse = 15000;
                goemonPhysics.JumpImpulse = 1200000;
                goemon.addComponent(new BasicPhysicsComponent(goemon, goemonPhysics));

                Box goemonMainBody = ShapeFactory.CreateRectangle("goemonMainBody", goemon, true, false, 90, 160, goemon.Position, true, GameLayers.MIDDLE_PLAY_AREA, GameConstants.TANGIBLE_BODY_TAG);
                Box goemonPortalBody = ShapeFactory.CreateRectangle("goemonPortalBody", goemon, true, false, 20, 20, goemon.Position, true, GameLayers.MIDDLE_PLAY_AREA, GameConstants.OPEN_DOOR_TAG);
                Box goemonInteractBody = ShapeFactory.CreateRectangle("goemonInteractBody", goemon, false, false, 95, 140, new Vector2(135 + 100, 130 + 200), false, GameLayers.MIDDLE_PLAY_AREA, Color.Blue);
                Box goemonTriggerBody = ShapeFactory.CreateRectangle("goemonTriggerBody", goemon, false, false, 95, 140, new Vector2(135 + 100, 130 + 200), false, GameLayers.MIDDLE_PLAY_AREA, Color.AliceBlue);

                Box goemonTriggerBody2 = ShapeFactory.CreateRectangle("goemonTriggerBody2", goemon, false, false, 200, 140, new Vector2(135 + 100, 130 + 200), false, GameLayers.MIDDLE_PLAY_AREA, Color.AliceBlue);

                List<CollisionBody> goemonBodies = new List<CollisionBody>();
                goemonBodies.Add(goemonMainBody);
                goemonBodies.Add(goemonPortalBody);
                goemonBodies.Add(goemonInteractBody);
                goemonBodies.Add(goemonTriggerBody);
                //goemonBodies.Add(goemonTriggerBody2);
                //goemonBodies.Add(earthCastingArea);
                goemon.addComponent(new AnimatedCollisionComponent(goemon, goemonBodies));

                // listener general de colisiones para mario
                EventManager.Instance.addCollisionListener(goemon, new SoftBodyCollisionResponse(goemon));

                Camera2D camera = new Camera2D(Program.GAME, goemon);
                Program.GAME.Camera = camera;
                // mover camara a un target random lejos
                camera.MoveSpeed = 2f;

                // debería ir código para cargar la lista de rooms y doors de los xml
                AreaEntity roomTestM = new AreaTestMetroid();

                this.hasLoaded = true;
            }
            else
            {
                throw new InvalidOperationException("El WorldManager ya ha sido cargado anteriormente.");
            }
        }