예제 #1
0
        public void LoadContent(ContentManager Content, World world,PhysicsScene phy)
        {
            this.world = world;
            parse.LoadContent(Content);
            map = parse.dynMap();

            for (int i = 0; i <= map.GetLength(0) - 1; i++)
            {
                if (map[i,0] == 1) //PLATEFORME
                {
                    MovingPlatforme mov = new MovingPlatforme();
                    mov.LoadContent(world, new Vector2(map[i,3], map[i, 4]), new Vector2(map[i, 1], map[i, 2]),Content,mondico[map[i,8]],(PlatformeDirection)map[i,5], map[i, 6], map[i,7]);
                    listMov.Add(mov);
                }else if (map[i, 0] == 2){ //ENEMIE
                    Enemy en = new Enemy();
                    en.LoadContent(world, Content, new Vector2(map[i, 1], map[i, 2]),phy);
                    listEnnemy.Add(en);
                }
            else if (map[i, 0] == 3)
            { //BOSS
              boss.LoadContent(Content, world, new Vector2(map[i, 1], map[i, 2]), new Vector2(map[i, 3], map[i, 4]));
            }

        }
        }
예제 #2
0
파일: Enemy.cs 프로젝트: Woktopus/Acllacuna
		public override void LoadContent(World world, ContentManager content, Vector2 position, PhysicsScene physicsScene)
		{
			base.LoadContent(world, content, position, physicsScene);

			Vector2 size = this.size * sizeRatio;

			CircleShape circle1 = new CircleShape(0.1f, 1f);
			CircleShape circle2 = new CircleShape(0.1f, 1f);
			CircleShape circle3 = new CircleShape(0.1f, 1f);
			CircleShape circle4 = new CircleShape(0.1f, 1f);

			circle1.Position = new Vector2(-((size.X / 2) + 0.2f), (size.Y + 0.1f) / 2);
			circle2.Position = new Vector2((size.X / 2) + 0.2f, (size.Y + 0.1f) / 2);
			circle3.Position = new Vector2(-((size.X / 2) + 0.2f), (size.Y - 0.3f) / 2);
			circle4.Position = new Vector2((size.X / 2) + 0.2f, (size.Y - 0.3f) / 2);

			sensors[0] = body.CreateFixture(circle1, (int)-(100 + id));
			sensors[1] = body.CreateFixture(circle2, (int)-(200 + id));
			sensors[2] = body.CreateFixture(circle3, (int)-(300 + id));
			sensors[3] = body.CreateFixture(circle4, (int)-(400 + id));

			sensors[0].IsSensor = true;
			sensors[1].IsSensor = true;
			sensors[2].IsSensor = true;
			sensors[3].IsSensor = true;
		}
예제 #3
0
 public void LoadContent(PhysicsScene scene , ContentManager Content)
 {
     this.scene = scene;
     this.Content = Content;
 }
예제 #4
0
        public virtual void LoadContent(World world, ContentManager content, Vector2 position, PhysicsScene physicsScene)
		{
			SetSize();

            this.physicsScene = physicsScene;

			Vector2 size = this.size * sizeRatio;

            body = BodyFactory.CreateRectangle(world, size.X, size.Y - 0.1f, 1f);

            body.BodyType = BodyType.Dynamic;

            body.FixedRotation = true;

            body.Position = position;

            body.Mass = 50;

            dagger.LoadContent(content, world, new Vector2(1, 0.5f), this.GetPositionFromBody(), "Graphics/lame_hitbox");

            CircleShape circle1 = new CircleShape(0.1f, 1f);
            CircleShape circle2 = new CircleShape(0.1f, 1f);
            CircleShape circle3 = new CircleShape(0.1f, 1f);
            CircleShape circle4 = new CircleShape(0.1f, 1f);
            CircleShape circle5 = new CircleShape(0.1f, 1f);
			CircleShape circle6 = new CircleShape(0.1f, 1f);
			CircleShape circle7 = new CircleShape(0.1f, 1f);
			CircleShape circle8 = new CircleShape(0.1f, 1f);
			CircleShape circle9 = new CircleShape(0.1f, 1f);
			CircleShape circle10 = new CircleShape(0.1f, 1f);
			CircleShape circle11 = new CircleShape(0.1f, 1f);
			CircleShape circle12 = new CircleShape(0.1f, 1f);
			CircleShape circle13 = new CircleShape(0.1f, 1f);

            circle1.Position = new Vector2(-((size.X / 2) - 0.2f), (size.Y - 0.1f) / 2);
            circle2.Position = new Vector2(0, (size.Y - 0.1f) / 2);
            circle3.Position = new Vector2((size.X / 2) - 0.2f, (size.Y - 0.1f) / 2);

			circle4.Position = new Vector2(-size.X / 2, -(size.Y - 0.1f) / 2);
			circle5.Position = new Vector2(-size.X / 2, (size.Y - 0.1f) / 2);
			circle6.Position = new Vector2(-size.X / 2, 0);
			circle7.Position = new Vector2(size.X / 2, -(size.Y - 0.1f) / 2);
			circle8.Position = new Vector2(size.X / 2, (size.Y - 0.1f) / 2);
			circle9.Position = new Vector2(size.X / 2, 0);
			circle10.Position = new Vector2(size.X / 2, -(size.Y - 0.1f) / 4);
			circle11.Position = new Vector2(size.X / 2, (size.Y - 0.1f) / 4);
			circle12.Position = new Vector2(-size.X / 2, -(size.Y - 0.1f) / 4);
			circle13.Position = new Vector2(-size.X / 2, (size.Y - 0.1f) / 4);

			feet[0] = body.CreateFixture(circle1);
			feet[1] = body.CreateFixture(circle2);
			feet[2] = body.CreateFixture(circle3);

			bumpers[0] = body.CreateFixture(circle4);
			bumpers[1] = body.CreateFixture(circle5);
			bumpers[2] = body.CreateFixture(circle6);
			bumpers[3] = body.CreateFixture(circle7);
			bumpers[4] = body.CreateFixture(circle8);
			bumpers[5] = body.CreateFixture(circle9);
			bumpers[6] = body.CreateFixture(circle10);
			bumpers[7] = body.CreateFixture(circle11);
			bumpers[8] = body.CreateFixture(circle12);
			bumpers[9] = body.CreateFixture(circle13);

            directionRegard = DirectionEnum.RIGHT;

			SetIDS();

			LoadAnimation(content);
		}