コード例 #1
0
 public Debugging(List<Player> players, MapReader map, Viewport viewport)
 {
     this.players = players;
     this.viewport = viewport;
     terminalDataShown = new List<String>();
     this.map = map;
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: Vergilreborn/ACM_Projects
 public void connect(MapReader map)
 {
     this.map = map;
 }
コード例 #3
0
ファイル: Game1.cs プロジェクト: Vergilreborn/ACM_Projects
        /// <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);

            //Initalize the keyBoardStates
            current = previous = Keyboard.GetState();

            //initialize the player by Texture,position,width,height,speed
            redMan = new Player(Content.Load<Texture2D>("RedMan"), Content.Load<Texture2D>("Sprites/ShipSprite1"), new Vector2(50, 50),
                                new Rectangle(0,0,60,60), new Rectangle(0,0,32,32), 4.0f,0,Content,graphics.GraphicsDevice.Viewport);
            blueMan = new Player(Content.Load<Texture2D>("BlueMan"),Content.Load<Texture2D>("Sprites/ShipSprite2"), new Vector2(graphics.PreferredBackBufferWidth - 120, 50),
                                new Rectangle(0, 0, 60, 60), new Rectangle(0, 0, 32, 32), 4.0f, 1, Content, graphics.GraphicsDevice.Viewport);
            titleScreen = Content.Load<Texture2D>("Graphics/TitleScreenForGame");

            //Builds a map and lets the first test map go
            map = new MapReader(Content.Load<Texture2D>("XuCubeTiles"));
            map.init();
            map.buildMap("Content/Levels/level",0);

            players = new List<Player>();
            players.Add(redMan);
            players.Add(blueMan);

            //Building the camera
            cam = new Camera(graphics.GraphicsDevice.Viewport, Vector2.Zero);
            cam.Follow(redMan);

            //Creates the terminal
            debugTerminal = new Debugging(players, map, graphics.GraphicsDevice.Viewport);

            //initialize font
            font = Content.Load<SpriteFont>("SpriteFont1");
        }