Example #1
0
 public void Draw(SpriteBatch batch, Camera camera)
 {
     if (image != null)
     {
         batch.Draw(image, camera.GetRelativePosition(Position), Color.White);
     }
 }
Example #2
0
 public void Draw(SpriteBatch batch, Camera camera)
 {
     if (image != null)
     {
         batch.Draw(image, camera.GetRelativePosition(Position), Color.White);
     }
 }
Example #3
0
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            int index = 0;

            foreach (Vector2 v in clouds)
            {
                spriteBatch.Draw(cloudTexture, camera.GetRelativePosition(v) * 0.2f, null, Color.White, 0.0f,
                                 Vector2.Zero, 1.0f, (SpriteEffects)(index % 2), 0.0f);
                index++;
            }

            scroll.Draw(spriteBatch, camera);

            foreach (Tile t in tiles)
            {
                if (t != null)
                {
                    t.Draw(spriteBatch, camera);
                }
            }

            player.Draw(spriteBatch, gameTime);
            foreach (Enemy e in enemies)
            {
                e.Draw(spriteBatch, gameTime);
            }
        }
        public void Draw(SpriteBatch spriteBatch, Camera camera)
        {
            Vector2 position = camera.GetRelativePosition(initialPos);
            while (position.X < 0)
                position.X += Helper.Resolution.X;
            while (position.X > Helper.Resolution.X)
                position.X -= Helper.Resolution.X;

            Vector2 mountainOffset = new Vector2(0, -110f);

            spriteBatch.Draw(mountains, position + mountainOffset, Color.White);
            spriteBatch.Draw(mountains, position - resx + mountainOffset, Color.White);
            spriteBatch.Draw(mountains, position + resx + mountainOffset, Color.White);

            spriteBatch.Draw(grass, position, Color.White);
            spriteBatch.Draw(grass, position - resx, Color.White);
            spriteBatch.Draw(grass, position + resx, Color.White);
        }
Example #5
0
        public void Draw(SpriteBatch spriteBatch, Camera camera)
        {
            Vector2 position = camera.GetRelativePosition(initialPos);

            while (position.X < 0)
            {
                position.X += Helper.Resolution.X;
            }
            while (position.X > Helper.Resolution.X)
            {
                position.X -= Helper.Resolution.X;
            }

            Vector2 mountainOffset = new Vector2(0, -110f);

            spriteBatch.Draw(mountains, position + mountainOffset, Color.White);
            spriteBatch.Draw(mountains, position - resx + mountainOffset, Color.White);
            spriteBatch.Draw(mountains, position + resx + mountainOffset, Color.White);

            spriteBatch.Draw(grass, position, Color.White);
            spriteBatch.Draw(grass, position - resx, Color.White);
            spriteBatch.Draw(grass, position + resx, Color.White);
        }
Example #6
0
 public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
 {
     animPlayer.Draw(camera.GetRelativePosition(Position), 1.0f, gameTime, direction, spriteBatch);
 }
Example #7
0
 public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
 {
     animPlayer.Draw(camera.GetRelativePosition(Position - new Vector2(0, 50)),
                     1.0f, gameTime, direction, spriteBatch);
     //spriteBatch.Draw(image, camera.GetRelativePosition(Position), Color.White);
 }