public void Update(GameTime gameTime, Player player) { centre = new Vector2(player._vt2_position.X + (player._i_width / 2) - 550, -50); transform = Matrix .CreateScale (new Vector3 (1,1,0)) * Matrix .CreateTranslation(new Vector3 (-centre .X,-centre .Y,0)); if (player._vt2_position.X < 320) player._vt2_position.X = 320; if (player._vt2_position.X > 1820) player._vt2_position.X = 1820; }
public Level2(Game g, ContentManager Content) { camera = new Camera(g.GraphicsDevice.Viewport); player = new Player(Content.Load<Texture2D>("Images/Player/Player_Standing"),g.Content , new Vector2(0, 0), 1000, 20 , 100, 0, 2, 4, 50f, 0.7f); font = g.Content.Load<SpriteFont>("Fonts/Arial"); // Khởi tạo list Enemy liEnemy = new List<Enemy>(); LiHearth = new List<Effect>(); LiMana = new List<Effect>(); background = Content.Load<Texture2D>("Images/Background/Level2/Level2"); healthTexture = Content.Load<Texture2D>("Images/HealthBar/Healthbar"); effect = new Effect(Content.Load<Texture2D>("Images/Effect/Effect_01") , Vector2.Zero, 0, 1, 4, 100, 1.2f); this.g = g; Hit = Content.Load<SoundEffect>("Sounds/Hit"); HitInstance = Hit.CreateInstance(); Health = Content.Load<SoundEffect>("Sounds/UpLevel"); HealthInstance = Health.CreateInstance(); }