Beispiel #1
0
        public void Start()
        {
            Scene.endGame = false;

            // Background
            SBG = new ScrollingBackground(AM.GetTexture("Background.png"), 100.0);

            // Player
            ShipSpecs specs = new ShipSpecs();

            specs.Level      = 1;
            specs.Velocity   = 400.0;
            specs.HP         = 5;
            specs.MaxHP      = 50;
            specs.Damage     = 25;
            specs.MaxDamage  = 100;
            specs.LazerCount = 1;
            specs.Cooldown   = 0.3;
            player           = new Ship(Scene, new DrawComponent(AM.GetTexture("Ship.png"), new Size(64.0, 64.0)), new TransformComponent(new Point(200.0, 700.0)), specs);
            Scene.NewActors.Add(player);
            PM.CreateBoxComponent(new Size(64.0, 64.0), player);

            State = GameState.InProgress;

            Window.ScoreBar.Maximum = MaxScore;
        }
        protected override void LoadContent()
        {
            base.LoadContent();

            var Content = GameRef.Content;

            // Add the basic font to be used
            font = Content.Load<SpriteFont>("menuFont");

            // Create the scrolling background
            background = Content.Load<Texture2D>("starfield_large");
            scrollingBackground = new ScrollingBackground();
            scrollingBackground.Load(GraphicsDevice, background);

            // Reset the instance of the game field
            ResetGameFull();

            gameOverMessage = new OnScreenMessage("G A M E    O V E R !", 3000f, font);
        }