コード例 #1
0
ファイル: Game1.cs プロジェクト: sogatron/Kismet
        /// <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);
            level01 = Content.Load<Level>("Levels/Level_01");
            level01.Initialise(Content);
            player = new Player(this.Content, "XML Documents/DanAnimations", level01);
            goblin = new Enemy(this.Content, "XML Documents/GoblinAnimations", level01);
            goblin1 = new Enemy(this.Content, "XML Documents/GoblinAnimations", level01);
            goblin2 = new Enemy(this.Content, "XML Documents/GoblinAnimations", level01);
            player.Position = new Vector2(0.0f, 420.0f);

            goblin.Position = new Vector2(500.0f, 420.0f);
            goblin1.Position = new Vector2(1000.0f, 420.0f);
            goblin2.Position = new Vector2(200.0f, 420.0f);
            // TODO: use this.Content to load your game content here
        }
コード例 #2
0
ファイル: Kismet.cs プロジェクト: sogatron/Kismet
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            GV.ContentManager = Content;
            TDManager.Initialize();
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // Old loading method
            level = Content.Load<Level>("Levels/Level_01");
            // New loading method
            //level = Level.Load("../../../../Kismet Content/Levels/Level01_A.xml");
            level.Initialise(Content);

            GV.Level = level;
            GV.SpriteBatch = spriteBatch;

            GV.LEFT = "left";
            GV.RIGHT = "right";
            GV.GRAVITY = 1.0f;
            GV.ShowBoxes = true;

            player = new Player("XML Documents/DanAnimations", GV.Level.PlayerStartingPosition);

            GV.Player = player;

            Camera.WorldRectangle = new Rectangle(0, 0, GV.Level.Width, GV.Level.Height);
            Camera.Position = new Vector2(0, 0);
            Camera.ViewPortWidth = 1280;
            Camera.ViewPortHeight = 720;

            GV.EDITING = false;
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: sogatron/Kismet
        /// <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);
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;

            //graphics.GraphicsDevice.SetRenderTarget(new RenderTarget2D(graphics.GraphicsDevice, 1280, 720));

            //ResourceManager.Instance.Texture("Tiles", Content.Load<Texture2D>(System.IO.Path.Combine(@"Tiles\", "Tiles")));
            GV.ContentManager = Content;
            TDManager.Initialize();
            //level01 = Level.Load("../../../../Level EditorContent/Levels/Level01_A.xml");
            level01 = Content.Load<Level>("Levels/Level_01");
            level01.Initialise(Content);

            GV.Level = level01;
            GV.SpriteBatch = spriteBatch;

            GV.LEFT = "left";
            GV.RIGHT = "right";
            GV.GRAVITY = 1.0f;
            GV.ShowBoxes = true;

            player1 = new Player("XML Documents/DanAnimations", level01.PlayerStartingPosition);

            GV.Player = player1;

            // Setup the camera
            Camera.WorldRectangle = new Rectangle(0, 0, GV.Level.Width, GV.Level.Height);
            Camera.Position = new Vector2(0, 0);
            Camera.ViewPortWidth = pictureBox.Width;
            Camera.ViewPortHeight = pictureBox.Height;

            lastMouseState = Mouse.GetState();
            pictureBox_SizeChanged(null, null);

            GV.EDITING = true;
            followPlayer = false;
        }