Пример #1
0
 public TileModel(World world, int sx, int sy, int sw, int sh, int x, int y, int w, int h)
     : base(world)
 {
     Position = new Vector2(x, y);
       SourceRect = new Rectangle(sx, sy, sw, sh);
       DestRect = new Rectangle(x, y, w, h);
       Colour = Color.White;
       Solid = true;
 }
        public EditorController(World world, InputType type, PlayerIndex playerIndex)
        {
            this.world = world;
              inputManager = new InputManager(type, playerIndex);

              keyMap = new Dictionary<WorldAction, Inputs>();

              keyMap.Add(WorldAction.LoadWorld, Inputs.Load);
              keyMap.Add(WorldAction.SaveWorld, Inputs.Save);
        }
Пример #3
0
 public TileModel(World world, TileType type, int x, int y)
     : base(world)
 {
     Position = new Vector2(x, y);
       Colour = Color.White;
       Solid = true;
       SourceRect = SpriteSheetDimensions.SourceRect(type);
       DestRect = new Rectangle(x, y, SourceRect.Width, SourceRect.Height);
       Type = type;
 }
Пример #4
0
 public PlayerModel(World world, Vector2 position, int width, int height)
     : base(world)
 {
     this.Position = position;
       this.Width = width;
       this.Height = height;
       this.Gravity = world.GRAVITY;
       this.DestRect = new Rectangle((int)position.X, (int)position.Y, width, height);
       this.SourceRect = new Rectangle(0, 0, width, height);
       this.Bounds = new Rectangle(0, 0, Game1.ScreenWidth, Game1.ScreenHeight);
 }
Пример #5
0
        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);
              keyMap.Add(WorldAction.SelectNextTile, Inputs.Next);
              keyMap.Add(WorldAction.SelectPreviousTile, Inputs.Previous);
        }
Пример #6
0
 public EditorView(World world)
 {
     this.world = world;
 }
Пример #7
0
 public Model(World world)
 {
     this.world = world;
 }
Пример #8
0
 public CameraModel(World world)
     : base(world)
 {
     this.world = world;
 }
Пример #9
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
              ScreenWidth = GraphicsDevice.Viewport.Width;
              ScreenHeight = GraphicsDevice.Viewport.Height;

              bgMoon = Content.Load<Texture2D>("bgMoon");
              blockTexture = Content.Load<Texture2D>("block");
              levelTilesSpriteSheet = Content.Load<Texture2D>("sprites");
              debugFont = Content.Load<SpriteFont>("debugFont");

              world = new World();

              // Events
              events = new DebuggingEventHandler(this);

              // Views
              playerView = new PlayerView(world.player1);
              tileView = new TileView(world.tiles);
              playerDebugView = new PlayerDebugView(world.player1);
              editorView = new EditorView(world);
              backgroundView = new BackgroundView(world);

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

              k = Keyboard.GetState();
              pk = Keyboard.GetState();
        }
Пример #10
0
 public BackgroundView(World world)
 {
     this.world = world;
 }