public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; state = GameState.gsEdit; theBlob = new BlobManager(this); this.Components.Add(theBlob); frc = new FrameRateCounter(this); Components.Add(frc); staticBodyManager = new StaticBodyManager(this); this.Components.Add(staticBodyManager); rigidBodyManager = new RigidBodyManager(this); this.Components.Add(rigidBodyManager); staticBodyEditor = new StaticBodyEditor(this); this.Components.Add(staticBodyEditor); camera = new SceneCameraComponent(this); this.Components.Add(camera); input = new InputHandler(this); this.Components.Add(input); GuiManager manager = new GuiManager(this); this.Components.Add(manager); manager.AddButton(new Vector2(250, 250), "Button1", "THIS IS A LARGE CAPTION"); }
public SceneNode(Game game, string TextureName, Vector2 startingPosition) { this.game = game; camera = (SceneCameraComponent)game.Services.GetService(typeof(ISceneCameraComponent)); ScreenCentre.X = game.GraphicsDevice.Viewport.Width / 2; ScreenCentre.Y = game.GraphicsDevice.Viewport.Height / 2; textureName = TextureName; Position = startingPosition; LoadContent(); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { // TODO: Add your initialization code here base.Initialize(); vertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionNormalTexture.VertexElements); line = new VertexPositionColor[2]; basicEffect = new BasicEffect(GraphicsDevice, null); basicEffect.DiffuseColor = new Vector3(0.5f, 0.2f, 0.2f); basicEffect.Alpha = 0.5f; camera = (SceneCameraComponent)Game.Services.GetService(typeof(ISceneCameraComponent)); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { // TODO: Add your initialization code here base.Initialize(); /** * Parasite made up of 4 parts. * -Head * -BPart01 * -BPart02 * -BPart03 * -Tail */ init(); CreateParasite(6); camera = (SceneCameraComponent)Game.Services.GetService(typeof(ISceneCameraComponent)); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { camera = (SceneCameraComponent)Game.Services.GetService(typeof(ISceneCameraComponent)); base.Initialize(); }