public void StopTrying(List <GameObject> gameObjects) { this.Kill(gameObjects); Menuscreen mainmenu = new Menuscreen(game, null, gameObjects); gameObjects.Add(mainmenu); }
protected override void Initialize() //Runs when the game starts, after the constructor { //Flatredball stuff Renderer.UseRenderTargets = false; FlatRedBallServices.InitializeFlatRedBall(this, graphics); FlatRedBallServices.Game.IsMouseVisible = true; SpriteManager.Camera.UsePixelCoordinates(); //Creates the menuclass mainmenu = new Menuscreen(this, null, gameObjects); gameObjects.Add(mainmenu); //Creates the global data GlobalData.GlobalData.Initialize(this); lighting = Content.Load <Effect>("Lighting"); //Content.RootDirectory = "Content"; GlobalData.GlobalData.keyboardDispatcher = new KeyboardDispatcher(this.Window); //Initializes the //Sprite testlight = SpriteManager.AddManagedInvisibleSprite(); //testlight.Texture = FlatRedBallServices.Load<Texture2D>("/content/blue.jpg"); //SpriteManager.AddDrawableBatch(new CustomSpriteDrawableBatch(testlight, GlobalData.GlobalData.Lighting)); //float texturePixelWidth = testlight.Texture.Width; //float texturePixelHeight = testlight.Texture.Height; ////Now, we need to find out how many pixels per unit there are in our view at the Sprite's Z position: //float pixelsPerUnit = SpriteManager.Camera.PixelsPerUnitAt(testlight.Z); ////Now, we just have to use those two values to set the scale. //testlight.ScaleX = .5f * texturePixelWidth / pixelsPerUnit; //testlight.ScaleY = .5f * texturePixelHeight / pixelsPerUnit; base.Initialize(); }