Inheritance: Sprite
Exemplo n.º 1
0
 public Level(ContentManager content)
 {
     this.content = content;
     hero = new Hero(content, this);
     support1 = new Hero(content, this);
     support2 = new Hero(content, this);
     monster1 = new Monster(content, this);
 }
Exemplo n.º 2
0
		protected override void LoadContent() {
			spriteBatch = new SpriteBatch(GraphicsDevice);

			viewport = DefViewPort = GraphicsDevice.Viewport;
			viewport.X = 100;
			viewport.Y = 100;
			viewport.Width = 300;
			viewport.Height = 300;


			s = new Hero(Content.Load<Texture2D>("a"), new Vector2(0, 0), new Vector2(5, 5), 10, false, 120, 120, 113);
			s.Init("Jin", 100, 100, 0, new Vector2(2, 2));
		}
Exemplo n.º 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            mouseBody = BodyFactory.Instance.CreateRectangleBody(physicsSimulator, 20, 20, 1);
            mouseBody.IsStatic = true;
            //mouseBody.IgnoreGravity = true;
            heros = new Hero(physicsSimulator);
            camera = new Camera2D(new Vector2(1024, 768), heros.hBody.Position, null, null, null, null, null, null, null, null);
            camera.TrackingBody = heros.hBody;

            for (int i = 0; i < 4; i++)
            {
                circles[i] = Content.Load<Texture2D>("circles\\" + i);
                mPoint[i] = new Vector2(0, 0);
            }

            pltfrm = new Platform("Content\\mapData\\map", physicsSimulator);

            dot = Content.Load<Texture2D>("sprites\\dot");
            boxTex = Content.Load<Texture2D>("sprites\\box");
            //for (int i=0; i<8; i++)
            //    crate[i] = new Box(physicsSimulator, boxTex, i*100+100, 100, 95, 95, 2);
            //for (int i = 8; i < 16; i++)
            //    crate[i] = new Box(physicsSimulator, boxTex, (i-8) * 100 + 100, 200, 95, 95, 2);

            gndTex = Content.Load<Texture2D>("sprites\\ground");

            bgTex = Content.Load<Texture2D>("sprites\\sky");
            c1Tex = Content.Load<Texture2D>("sprites\\clouds");
            grassTex = Content.Load<Texture2D>("sprites\\grass");

            vpRect = new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);

            base.LoadContent();
        }