Beispiel #1
0
 public void Initialise(Animation animation, Vector2 position)
 {
     PlayerAnimation=animation;
     Position=position;
     Active = true;
     Health = 100;
 }
Beispiel #2
0
        protected override void Initialize()
        {
            base.Initialize();
            var animation = new Animation(
                Content.Load<Texture2D>("shipAnimation"),
                Vector2.Zero,
                115, 69, 8, 30,
                Color.White, 1f, true
                );
            player = new Player();
            player.Initialise(animation, CentrePosition());

            bgLayer1 = new ParallaxBackground();
            bgLayer2 = new ParallaxBackground();
            bgLayer3 = new ParallaxBackground();

            bgLayer1.Initialise(Content, "bgLayer1", GraphicsDevice.Viewport.Width, -2);
            bgLayer2.Initialise(Content, "bgLayer2", GraphicsDevice.Viewport.Width, -3);
            bgLayer3.Initialise(Content, "mainbackground", GraphicsDevice.Viewport.Width, -1);
        }