示例#1
0
 public BallView(BallSimulation Ballsimulation, Camera Camera, GraphicsDevice Graphics, Texture2D BallTexture)
 {
     ballSimulation = Ballsimulation;
     camera = Camera;
     ballTexture = BallTexture;
     backGroundTexture = new Texture2D(Graphics, 1, 1);
     backGroundTexture.SetData(new[] { Color.White });
 }
示例#2
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);
     ballTexture = Content.Load<Texture2D>("aqua-ball.png");
     ballSimulation = new BallSimulation();
     ballView = new BallView(graphics, ballSimulation, ballTexture);
 }
示例#3
0
        public BallView(BallSimulation ballSim, Camera viewCamera, GraphicsDevice graphics, Texture2D psyBall)
        {
            ballSimulation = ballSim;
            camera = viewCamera;
            ballTexture = psyBall;

            gameBox = new Texture2D(graphics, 1, 1);
            gameBox.SetData(new[] { Color.OrangeRed });
        }
        /// <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
            ballSimulation = new BallSimulation();
            ballTexture = Content.Load<Texture2D>("Ball.png");
            Camera camera = new Camera(GraphicsDevice.Viewport);
            ballView = new BallView(ballSimulation, camera, GraphicsDevice, ballTexture);
        }
示例#5
0
        public GameController(ContentManager cm, Camera cam, SpriteBatch sprite, MouseState mouse, GraphicsDevice graphics, BallSimulation ballSim)
        {
            content = cm;
            camera = cam;
            spriteBatch = sprite;
            this.graphics = graphics;
            this.ballSim = ballSim;

            explosionTexture = content.Load<Texture2D>("explosion");
            splitterTexture = content.Load<Texture2D>("spark");
            smokeTexture = content.Load<Texture2D>("smokePic");
            ballTexture = content.Load<Texture2D>("ball");
            pistolEffect = content.Load<SoundEffect>("fire");

            splitterView = new SplitterView(spriteBatch,camera, splitterTexture);
            smokeView = new SmokeView(spriteBatch, camera, smokeTexture);
            ballView = new BallView(ballSim, camera, graphics, ballTexture);
        }
示例#6
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            ballSimulation = new BallSimulation();

            base.Initialize();
        }
示例#7
0
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     camera = new Camera(graphics.GraphicsDevice.Viewport);
     // Create a new SpriteBatch, which can be used to draw textures.
     camera.setfieldsize();
     spriteBatch = new SpriteBatch(GraphicsDevice);
     ballSim = new BallSimulation();
     gameController = new GameController(Content, camera, spriteBatch, thisMouse, GraphicsDevice, ballSim);
     //  camera = new Camera(GraphicsDevice.Viewport);
     // explosionView = new ExplosionView(camera, spriteBatch, new Vector2(0.5f,0.5f), Content.Load<Texture2D>("explosion"));
     aimScope = Content.Load<Texture2D>("aim2");
 }