public static void checkInput(UiGrid passedGrid, InputMngr inputMngr) { if (inputMngr.checkInput(controls.pressEnter)) { UIObj activeObject = passedGrid.getSelObject(); activeObject.runInstruction(); } if (inputMngr.checkInput(controls.pressUp)) { passedGrid.updateGridPos(UiGrid.direction.up); } if (inputMngr.checkInput(controls.pressLeft)) { passedGrid.updateGridPos(UiGrid.direction.left); } if (inputMngr.checkInput(controls.pressDown)) { passedGrid.updateGridPos(UiGrid.direction.down); } if (inputMngr.checkInput(controls.pressRight)) { passedGrid.updateGridPos(UiGrid.direction.right); } passedGrid.updateSelected(); }
void Start() { instance = this; rightActivated = false; leftActivated = false; rightPushed = EntityScript.Type.None; leftPushed = EntityScript.Type.None; }
public void updateStates(InputMngr inputMngr) { switch (crtState) { case ARstate.AR_Adventure: arAdv.Update(inputMngr); break; case ARstate.AR_Conception: arConception.Update(inputMngr); break; case ARstate.AR_Continue: arContinue.Update(inputMngr); break; case ARstate.AR_Launch: arLaunch.Update(inputMngr); break; case ARstate.AR_Leave: arLeave.Update(inputMngr); break; case ARstate.AR_Main: arMain.Update(inputMngr); break; case ARstate.AR_Profile: arProfile.Update(inputMngr); break; case ARstate.AR_Start: arStart.Update(inputMngr); break; case ARstate.AR_Options: arOptions.Update(inputMngr); break; case ARstate.TestTri: testTri.Update(inputMngr); break; case ARstate.TestBill: testBill.Update(inputMngr); break; case ARstate.Test_v1: test_v1.Update(inputMngr); break; } }
//Public public void initialize() //Called in dreamer's iniitalize override function for the game class. Starts up all abstract realm realated managers (except Asset Manager). { inputMngr = new InputMngr(); uiMngr = new UiMngr(); spaceMngr = new SpaceMngr(); stateMngr = new StateMngr(); stateMngr.setCRTState(StateMngr.ARstate.AR_Launch, assetMngr); ulong rateToTicks = (ulong)10000000 / (ulong)AR.display.framerate; Console.WriteLine("ratetoTicks: " + rateToTicks); dreamer.TargetElapsedTime = new TimeSpan((long)rateToTicks); dreamer.IsFixedTimeStep = true; }
public override void Update(InputMngr inputMngr) { if (fcb.charSphere.Intersects(fallingBox) == true) { } else if (fcb.charSphere.Intersects(floor) == true) { } else { fcb.move(new Vector3(0, -0.01f, 0)); } //Need to make a generic player input checking system. if (inputMngr.getInputState() == InputMngr.InputState.playerKbrd) { if (inputMngr.checkInput(controls.holdRight)) { fcb.move(new Vector3(-0.1f, 0, 0)); } if (inputMngr.checkInput(controls.holdLeft)) { fcb.move(new Vector3(0.1f, 0, 0)); } if (inputMngr.checkInput(controls.pressJump)) { fcb.move(new Vector3(0, 1f, 0)); } if (inputMngr.checkInput(controls.debug)) { inputMngr.changeInputState(InputMngr.InputState.debugKbrd); } } //Taken from Triangle class need to make proper else if (inputMngr.getInputState().Equals(InputMngr.InputState.debugKbrd)) { //Basic Hori and Vert if (Keyboard.GetState().IsKeyDown(Keys.A)) { SpaceMngr.camPosition.X -= 0.1f; SpaceMngr.camTarget.X -= 0.1f; } if (Keyboard.GetState().IsKeyDown(Keys.D)) { SpaceMngr.camPosition.X += 0.1f; SpaceMngr.camTarget.X += 0.1f; } if (Keyboard.GetState().IsKeyDown(Keys.W)) { SpaceMngr.camPosition.Y -= 0.1f; SpaceMngr.camTarget.Y -= 0.1f; } if (Keyboard.GetState().IsKeyDown(Keys.S)) { SpaceMngr.camPosition.Y += 0.1f; SpaceMngr.camTarget.Y += 0.1f; } //Rotation if (Keyboard.GetState().IsKeyDown(Keys.Right)) { Matrix rotationMatrix = Matrix.CreateRotationY(MathHelper.ToRadians(0.1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } if (Keyboard.GetState().IsKeyDown(Keys.Left)) { Matrix rotationMatrix = Matrix.CreateRotationY(MathHelper.ToRadians(-0.1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } if (Keyboard.GetState().IsKeyDown(Keys.Up)) { Matrix rotationMatrix = Matrix.CreateRotationX(MathHelper.ToRadians(0.1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } if (Keyboard.GetState().IsKeyDown(Keys.Down)) { Matrix rotationMatrix = Matrix.CreateRotationX(MathHelper.ToRadians(-0.1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } //Zoom if (Keyboard.GetState().IsKeyDown(Keys.LeftShift)) { SpaceMngr.camPosition.Z += 0.1f; SpaceMngr.camTarget.Z += 0.1f; } if (Keyboard.GetState().IsKeyDown(Keys.LeftControl)) { SpaceMngr.camPosition.Z -= 0.1f; SpaceMngr.camTarget.Z -= 0.1f; } SpaceMngr.view = Matrix.CreateLookAt(SpaceMngr.camPosition, SpaceMngr.camTarget, Vector3.Up); if (inputMngr.checkInput(controls.debug)) { inputMngr.changeInputState(InputMngr.InputState.playerKbrd); } if (inputMngr.checkInput(controls.pressBack)) { toogleBillboard(); } if (inputMngr.checkInput(controls.pressEnter)) { toogleBoundingShapes(); } spaceMngr.camera.Update(deltaTime); spaceMngr.spacetest.Update(); } }
public override void Update(InputMngr inputMngr) { }
public override void Update(InputMngr inputMngr) { //Basic Hori and Vert if (Keyboard.GetState().IsKeyDown(Keys.A)) { SpaceMngr.camPosition.X -= 1f; SpaceMngr.camTarget.X -= 1f; } if (Keyboard.GetState().IsKeyDown(Keys.D)) { SpaceMngr.camPosition.X += 1f; SpaceMngr.camTarget.X += 1f; } if (Keyboard.GetState().IsKeyDown(Keys.W)) { SpaceMngr.camPosition.Y -= 1f; SpaceMngr.camTarget.Y -= 1f; } if (Keyboard.GetState().IsKeyDown(Keys.S)) { SpaceMngr.camPosition.Y += 1f; SpaceMngr.camTarget.Y += 1f; } //Rotation if (Keyboard.GetState().IsKeyDown(Keys.Right)) { Matrix rotationMatrix = Matrix.CreateRotationY(MathHelper.ToRadians(1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } if (Keyboard.GetState().IsKeyDown(Keys.Left)) { Matrix rotationMatrix = Matrix.CreateRotationY(MathHelper.ToRadians(-1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } if (Keyboard.GetState().IsKeyDown(Keys.Up)) { Matrix rotationMatrix = Matrix.CreateRotationX(MathHelper.ToRadians(1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } if (Keyboard.GetState().IsKeyDown(Keys.Down)) { Matrix rotationMatrix = Matrix.CreateRotationX(MathHelper.ToRadians(-1f)); SpaceMngr.camPosition = Vector3.Transform(SpaceMngr.camPosition, rotationMatrix); } //Zoom if (Keyboard.GetState().IsKeyDown(Keys.LeftShift)) { SpaceMngr.camPosition.Z += 1f; SpaceMngr.camTarget.Z += 1f; } if (Keyboard.GetState().IsKeyDown(Keys.LeftControl)) { SpaceMngr.camPosition.Z -= 1f; SpaceMngr.camTarget.Z -= 1f; } SpaceMngr.view = Matrix.CreateLookAt(SpaceMngr.camPosition, SpaceMngr.camTarget, Vector3.Up); //Scene Changing if (Keyboard.GetState().IsKeyDown(Keys.PageDown)) { stateMngr.setCRTState(States.StateMngr.ARstate.AR_Launch, assetMngr); } }
public void Update(InputMngr inputMngr) { }
//Functions public abstract void Update(InputMngr inputMngr);
public void updatePPS(InputMngr inputMngr) { framecounter.Update(inputMngr); }
public override void Update(InputMngr inputMngr) { throw new NotImplementedException(); }
public override void Update(InputMngr inputMngr) { switch (currentFocus) { case focus.profileCheck: { if (profileMngr.getProfileNum() > 0) { currentFocus = focus.profileSel; break; } if (ProfileMngr.currentProfile == null) { if (firstPass == true) { setProfileCheckUI(); } UiMngr.checkInput(gridOne, inputMngr); } else { throw new Exception("Something went wrong with the profile manager."); } } break; case focus.profileSel: { if (firstPass == true) { setProfileSelUI(); setProfileSelListUI(); } switch (subCurrentFocus) { case subFocus.profileSel: { UiMngr.checkInput(gridOne, inputMngr); if (inputMngr.checkInput(controls.goTestTri) == true) { stateMngr.setCRTState(States.StateMngr.ARstate.AR_Launch, assetMngr); } if (inputMngr.checkInput(controls.pressEnd) == true) { display.changeDisplay(); } } break; case subFocus.profileSelList: { UiMngr.checkInput(gridProfileSel, inputMngr); if (inputMngr.checkInput(controls.pressBack) == true) { subCurrentFocus = subFocus.profileSel; } } break; } } break; case focus.osti: { OSTI.Update(inputMngr); if (OSTI.getDone() == true) { profileName = OSTI.getText(); OSTI.setActive(false); if (profileMngr.checkForProfile(profileName) == false) { profileMngr.createProfile(profileName); currentFocus = focus.profileSel; } else { Console.WriteLine("Profile Already Exists."); OSTI = new OnScreenTextInput(); OSTI.setActive(true); } } } break; } }