Пример #1
0
 public GroundRenderSystem(Camera camera, GraphicsDevice graphics)
     : base("Ground")
 {
     this.camera = camera;
     this.graphicsDevice = graphics;
     this.LineBatch = new LineBatch(graphicsDevice);
 }
Пример #2
0
        /// <summary>
        /// Constructs a world with a specified gravity.
        /// </summary>
        /// <param name="gravity">The gravity of a world.</param>
        /// <param name="camera"> The camera which views the world.</param>
        /// <param name="spriteBatch">The spritebatch to which the world may render.</param>
        public World(Game Game, Vector2 gravity)
            : base(gravity)
        {
            this.Camera = new Camera(Game.GraphicsDevice);
            this.SpriteBatch = new SpriteBatch(Game.GraphicsDevice);
            this.BuildEvents(Game);

            Speed = 1;
        }
Пример #3
0
 public RenderSystem(SpriteBatch spritebatch, Camera camera)
     : base(typeof(Sprite), typeof(ITransform))
 {
     this.spriteBatch = spritebatch;
     this.camera = camera;
 }
Пример #4
0
        /// <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);

            // TODO: use this.Content to load your game content here
            brickTexture = Content.Load<Texture2D>("Brick");
            playerTexture = Content.Load<Texture2D>("Player");
            monsterTexture = Content.Load<Texture2D>("Monster");
            bulletTexture = Content.Load<Texture2D>("Bullet");

            player = new Player(playerTexture, bulletTexture, new Vector2(ScreenHelper.Viewport.Width / 2 - playerTexture.Width / 2, ScreenHelper.Viewport.Height - playerTexture.Height));
            wall = new Wall(13, -1);

            camera = new Camera(GraphicsDevice);
        }
Пример #5
0
 public DebugSystem(World world)
     : base(33)
 {
     this._Camera = world.Camera;
     this.Console = new DebugConsole(world);
 }
 public EntityRemovalSystem(Camera camera)
     : base(typeof(ITransform))
 {
     this.camera = camera;
 }