Example #1
0
 public ExplosionView(SpriteBatch spriteBatch, Texture2D sparkTexture, Camera camera, Vector2 position)
 {
     this.spriteBatch = spriteBatch;
     this.sparkTexture = sparkTexture;
     this.cam = camera;
     splitterSystem = new SplitterSystem(position);
 }
Example #2
0
 public void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
 {
     for (int i = 0; i < MAX_PARTICLES; i++)
     {
         particles[i].Draw(spriteBatch, camera, texture);
     }
 }
Example #3
0
        internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
        {
            Vector2 viewPosition = camera.GetVisualPositions(position);
            Vector2 visualRadius = camera.GetVisualPositions(radius);

            Rectangle rect = new Rectangle((int)viewPosition.X, (int)viewPosition.Y, (int)visualRadius.X, (int)visualRadius.Y);

            spriteBatch.Draw(texture, rect, Color.White);
        }
Example #4
0
 public GameView(GameModel model, SpriteBatch spriteBatch, Texture2D tileTexture, Texture2D fishTexture, 
                 Texture2D sparkTexture, Texture2D fishBoneTexture, Texture2D penguinTexture, 
                 Texture2D canTexture, Texture2D monsterTexture, Camera camera)
 {
     this.model = model;
     this.spriteBatch = spriteBatch;
     this.tileTexture = tileTexture;
     this.fishTexture = fishTexture;
     this.sparkTexture = sparkTexture;
     this.canTexture = canTexture;
     this.fishBoneTexture = fishBoneTexture;
     this.penguinTexture = penguinTexture;
     this.monsterTexture = monsterTexture;
     this.camera = camera;
 }
Example #5
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);

            tileTexture = Content.Load<Texture2D>("tile");
            penguinTexture = Content.Load<Texture2D>("penguin");
            canTexture = Content.Load<Texture2D>("can");
            fishTexture = Content.Load<Texture2D>("fish2");
            sparkTexture = Content.Load<Texture2D>("sparkblue");
            fishBoneTexture = Content.Load<Texture2D>("fishbone");
            monsterTexture = Content.Load<Texture2D>("seal");

            spriteFont = Content.Load<SpriteFont>("SpriteFont");

            eatSound = Content.Load<SoundEffect>("burp");
            winSound = Content.Load<SoundEffect>("applause");

            menu = new Menu(spriteBatch);

            menu.LoadContent(Content);
            camera = new Camera(graphics.PreferredBackBufferHeight, graphics.PreferredBackBufferWidth, Level.LEVEL_WIDTH,
                                Level.LEVEL_HEIGHT);
            view = new GameView(model,spriteBatch,tileTexture,fishTexture,sparkTexture,
                                fishBoneTexture,penguinTexture, canTexture, monsterTexture, camera);
            soundView = new SoundView();
        }