/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { Assets.Load(Content); CurrentKs = OldKs = Keyboard.GetState(); Scene = new GameScene(); base.Initialize(); }
public InfoScene(Scene prevScene) : base() { List<Button> buttons = new List<Button>(); buttons.Add(new Button("main menu", ToMenu)); buttons.Add(new Button("quit", Exit)); menu = new Menu("Info", buttons); this.prevScene = prevScene; }
public PauseScene(Scene prevScene) : base() { List<Button> buttons = new List<Button>(); buttons.Add(new Button("resume", Play)); buttons.Add(new Button("main menu", ToMenu)); buttons.Add(new Button("quit", Exit)); menu = new Menu("Paused", buttons); this.prevScene = prevScene; }
protected Core iniPhysics() { CoreDescription coreDesc = new CoreDescription(); Core core = new Core(coreDesc, null); core.SetParameter(PhysicsParameter.VisualizationScale, 2.0f); core.SetParameter(PhysicsParameter.VisualizeCollisionShapes, true); core.SetParameter(PhysicsParameter.VisualizeClothMesh, true); core.SetParameter(PhysicsParameter.VisualizeJointLocalAxes, true); core.SetParameter(PhysicsParameter.VisualizeJointLimits, true); core.SetParameter(PhysicsParameter.VisualizeFluidPosition, true); core.SetParameter(PhysicsParameter.VisualizeFluidEmitters, false); // Slows down rendering a bit too much core.SetParameter(PhysicsParameter.VisualizeForceFields, true); core.SetParameter(PhysicsParameter.VisualizeSoftBodyMesh, true); RemoteDebugger debugger = core.Foundation.RemoteDebugger; debugger.Connect("localhost"); if (debugger.IsConnected) { Console.Write("Debugger connected\n"); } SceneDescription sceneDesc = new SceneDescription(); sceneDesc.Gravity = new StillDesign.PhysX.MathPrimitives.Vector3(0, -10.0f, 0); scene = core.CreateScene(sceneDesc); return core; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { Assets.Load(Content); PlayerTexture = Content.Load<Texture2D>("player"); RockTexture = Content.Load<Texture2D>("asteroid"); CurrentKs = OldKs = Keyboard.GetState(); Scene = new MenuScene(); base.Initialize(); }