示例#1
0
 public PlayerModel(World world, Vector2 position, int w, int h)
     : base(world)
 {
     Position = position;
       width = w;
       height = h;
 }
示例#2
0
 public BallModel(World world, int x, int y, int w, int h)
     : base(world)
 {
     this.world = world;
       Position = new Vector2(x, y);
       width = w;
       height = h;
 }
        public MouseController(World world, InputType type, PlayerIndex playerIndex)
        {
            this.world = world;
              inputManager = new InputManager(type, playerIndex);
              keyMap = new Dictionary<WorldAction, Inputs>();

              keyMap.Add(WorldAction.AddTile, Inputs.A);
              keyMap.Add(WorldAction.RemoveTile, Inputs.B);
        }
示例#4
0
 public Model(World world)
 {
     this.world = world;
 }
示例#5
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

              ScreenWidth = GraphicsDevice.Viewport.Width;
              ScreenHeight = GraphicsDevice.Viewport.Height;

              blockTexture = Content.Load<Texture2D>("block");
              font = Content.Load<SpriteFont>("genericFont");

              // World
              world = new World();

              // Controllers
              player1Controller = new PlayerController(world.player1, InputType.Keyboard, PlayerIndex.One);
              mouseController = new MouseController(world, InputType.Mouse, PlayerIndex.One);

              // Views
              playerView = new PlayerView(world.player1, blockTexture);
              playerViewText = new PlayerViewText(world.player1, font);
              playerViewGrid = new PlayerViewGrid(world.player1, blockTexture);
              tileView = new TileView(world.tiles, blockTexture);
              ballView = new BallView(world.ball, blockTexture);
        }