示例#1
0
 public AgentSprite(CatAndMouseGame game, Texture2D texture, Vector2 position, UserSprite target, GridCell[,] gridCell, Graph graph)
     : base(game, texture, position)
 {
     this.target = target;
     this.gridCell = gridCell;
     this.graph = graph;
 }
        public CatAndMouseGame()
        {
            graphics = new GraphicsDeviceManager(this);
            // Assignment: Create a "world" for your kanye and taylor that is 1024x768
            graphics.PreferredBackBufferWidth = SCREEN_WIDTH;
            graphics.PreferredBackBufferHeight = SCREEN_HEIGHT;
            Content.RootDirectory = "Content";

            // For creating the cell grid
            grid = new GridCell[graphics.PreferredBackBufferWidth / cellSize, graphics.PreferredBackBufferHeight / cellSize];
            graph = new Graph(this, grid);

            this.IsMouseVisible = true;
        }
 protected override void Initialize()
 {
     IsGameOver = false;
     IsPlayerCaught = false;
     IsFirstPlay = true;
     remainingSeconds = 0;
     graph = new Graph(this, grid);
     base.Initialize();
 }