void LateUpdate() { GameObject robot = GameManager.gameManager.Robot.gameObject; RobotMovement movement = robot.GetComponent <RobotMovement>(); if (collider.bounds.Intersects(robot.collider.bounds)) { if (robot.transform.position.y > transform.position.y) { float penetrationAmount = Mathf.Abs(robot.transform.position.y - transform.position.y) - (robot.collider.bounds.extents.y + collider.bounds.extents.y) - .01f; robot.transform.Translate(new Vector3(0f, -penetrationAmount, 0f)); movement.OnPlatform = true; } else { movement.OnPlatform = false; } } else { movement.OnPlatform = false; } if (robot.transform.position.x > transform.position.x - collider.bounds.extents.x && robot.transform.position.x < transform.position.x + collider.bounds.extents.x) { if (robot.transform.position.y > transform.position.y && robot.transform.position.y < transform.position.y + robot.collider.bounds.extents.y + collider.bounds.extents.y + 0.4f) { robot.transform.position += new Vector3(lastMovement.x, 0f, 0f); lastMovement = Vector3.zero; } } }
/// <summary> /// Handles the errors start. /// </summary> void HandleErrorsStart() { _ai = GetComponent <RobotAI>(); _rcd = GetComponent <RobotCountToDeath>(); if (_rcd == null) { Debug.LogError("ERROR! Set the RobotCountToDeath Script in the prefab."); } if (_ai == null) { Debug.LogError("ERROR! Set the RobotAI Script in the prefab."); } _rm = GetComponent <RobotMovement>(); if (_rm == null) { Debug.LogError("ERROR! Set the RobotMovement Script in the prefab."); } _op = GetComponent <ObjectPicking>(); if (_op == null) { Debug.LogError("ERROR! Set the ObjectPicking Script in the prefab."); } if (gameManager == null) { Debug.LogError("ERROR! Set the GameManager object when spawning."); } _gm = gameManager.GetComponent <GameManager>(); _colorOfRobot = robotColor; }
public void OnRobotMovementRequiest(RobotMovement movement, Piece piece, int destCol, int destRow) { if (RobotMovementReqest != null) { RobotMovementReqest(this, new RobotMovementRequestEventArgs(movement, piece, destCol, destRow)); } }
// Update is called once per frame void Update() { if (transform.childCount > 0) { if (!activated) { if (transform.GetChild(0).gameObject.tag == "Robot") { GameObject robot = transform.GetChild(0).gameObject; if (robot.transform.position.x == transform.position.x && robot.transform.position.z == transform.position.z) { RobotMovement robot_scr = robot.GetComponent <RobotMovement>(); AudioManager.instance.Play("tile_warp"); if (robot_scr.Respawn()) { activated = true; } } } } } else { activated = false; } }
private void Awake() { levelGenerator = GetComponent <LevelGenerator>(); levelGeometry = levelGenerator.Generate(); levelGeometry.parent = transform; levelGeometry.position -= Vector3.forward * levelGenerator.LaneSize; initialPosition = levelGeometry.position; var robot = RobotFactory.GetRobot(RobotChangeManager.CurrentType); robotMov = robot.GetComponent <RobotMovement> (); Debug.Assert(robotMov != null, "Robot Prefab has no Robot Movement Component"); robotMov.Init(this); var spawners = GetComponentsInChildren <Spawner> (); foreach (var s in spawners) { s.Init(this); } var hudController = GetComponentInChildren <HUDController> (); if (hudController != null) { hudController.Init(robot); } FillAvailableLastLanes(); }
protected virtual void Start() { robotController = GetComponent <RobotController>(); robotCharacter = GetComponent <RobotCharacter>(); robotWeapon = GetComponent <RobotWeapon>(); robotMovement = GetComponent <RobotMovement>(); }
void Awake() { gameController = GameObject.Find("GameController").GetComponent <GameController>(); fade = GameObject.Find("FadeCanvas").GetComponent <Fading>(); robot = GameObject.Find("Robot"); robotMovement = robot.GetComponent <RobotMovement> (); }
/// <summary> /// Constructor for making a new movement request. /// </summary> /// <param name="movementType">the kind of the movement</param> /// <param name="pieceType">The type of the piece must be placed (only needed when placing a piece onto the table)</param> /// <param name="destCol">the destination column of the movement (only needed when placing a piece onto the table)</param> /// <param name="destRow">the destination row of the movement (only needed when placing a piece onto the table)</param> public RobotMovementRequestEventArgs(RobotMovement movementType, Piece pieceType, int destCol, int destRow) : base() { this.pieceType = pieceType; this.movementType = movementType; this.destCol = destCol; this.destRow = destRow; }
void Start() { movementOne = player[0].playerObject.GetComponent <RobotMovement>(); movementTwo = player[1].playerObject.GetComponent <RobotMovement1>(); SetStats(0); SetStats(1); }
private void Awake() { robMov = GetComponentInParent <RobotMovement> (); Debug.Assert(robMov, "Couldn't find RobotMovement in parent"); animator = GetComponent <Animator> (); robMov.OnStartedMoving += StartMoving; }
void Start() { bubbleDelayTime = 0.2f; animatorController = GetComponent <PlayerAnimationController>(); PlayerNetWorkData data = GameGlobalData.playerList[fd]; float posx = data.initPosition.x; float posy = data.initPosition.y; int row = (int)Mathf.Abs(posy / GameConst.tileHeight); float posz = GameConst.staticLayers[row].position.z; transform.position = new Vector3(posx, posy, posz); GameGlobalData.robotList.Add(fd, this); movement = GetComponent <RobotMovement>(); movement.speed = data.speed; movement.maxSpeed = data.maxSpeed; movement.maxDistance = data.maxDistance; bubbleCount = data.bubbleCount; maxBubbleCount = data.maxBubbleCount; power = data.power; maxPower = data.maxPower; boomTime = data.boomTime; bubbles = new List <Bubble>(); colliderBox = GetComponent <PlayerColliderBox>(); preBubbleList = new List <BubbleData>(); }
// Use this for initialization void Start() { robotMovement = GetComponentInChildren <RobotMovement>(); robotAttack = GetComponentInChildren <RobotAttack>(); robotFollow = GetComponentInChildren <RobotFollow>(); robotLaborerControl = GetComponentInChildren <RobotLaborerControl>(); rigid = GetComponentInChildren <Rigidbody>(); robotFollow.DisableCameras(); /*if (isAI) * { * //turn off cameras * Camera[] cameras = GetComponentsInChildren<Camera>(); * foreach (Camera c in cameras) * { * Destroy(c.gameObject); * } * robotFollow.enabled = false; * robotMovement.moveSpeed = 0; * robotAttack.canRam = false; * }*/ /* NetworkManager.Instance.OwnerSh+= (newPlayer) => * { * Debug.Log("hi"); * ipAddress = Network.player.ipAddress; * log = GameObject.Find("Log").GetComponent<Text>(); * log.text = "owner changed to me"; * * };*/ Debug.Log("event listener created"); }
protected virtual void Awake() { movement = GetComponent <RobotMovement>(); obstacleDetector = GetComponent <RobotObstacleDetector>(); cleanFloorDetector = GetComponent <RobotCleanFloorDetector>(); dirtyFloorDetector = GetComponent <RobotDirtyFloorDetector>(); }
void Awake() { showPosters = GameObject.Find("ShowPosters").GetComponent <Toggle>(); posters = GameObject.Find("Poster"); gameController = GameObject.Find("GameController").GetComponent <GameController>(); fade = GameObject.Find("FadeCanvas").GetComponent <Fading>(); robot = GameObject.Find("Robot"); robotMovement = robot.GetComponent <RobotMovement> (); }
public static void SetInBubble(int row, int col) { GameGlobalData.player.GetComponent <PlayerMovement>().setInBubble(row, col); foreach (RobotInputController robot in GameGlobalData.robotList.Values) { RobotMovement movement = robot.GetComponent <RobotMovement>(); movement.setInBubble(row, col); } }
// Start is called before the first frame update void Start() { myImage = GetComponent <Image>(); myImage.enabled = false; player = GameObject.Find("Player"); playerController = player.GetComponent <PlayerController>(); playerMouse = player.GetComponentInChildren <MouseLook>(); robotMove = player.GetComponentInChildren <RobotMovement>(); robotAnimator = player.GetComponentInChildren <Animator>(); }
void Start() { spaces = new GameObject[size_x, size_y]; string parentTag = this.tag; // Sets up multidimensional array of grid tiles and sets their world position. for (int i = 0; i < size_y; i++) { for (int j = 0; j < size_x; j++) { int floor_rand = Random.Range(0, 150); if (floor_rand <= 120 || i == 0 || i == 1) { spaces[j, i] = Instantiate(floor_prefab, new Vector3(j, 0, i), Quaternion.identity); } else if (floor_rand > 120 && floor_rand <= 130) { spaces[j, i] = Instantiate(spin_floor_prefab, new Vector3(j, 0, i), Quaternion.identity); } else if (floor_rand > 130 && floor_rand <= 140) { spaces[j, i] = Instantiate(fall_floor_prefab, new Vector3(j, 0, i), Quaternion.identity); } else if (floor_rand > 140) { spaces[j, i] = Instantiate(teleport_floor_prefab, new Vector3(j, 0, i), Quaternion.identity); } spaces[j, i].transform.parent = this.transform; spaces[j, i].name = "Space " + i.ToString() + "," + j.ToString(); spaces[j, i].gameObject.tag = parentTag; Rigidbody rb = spaces[j, i].gameObject.AddComponent <Rigidbody>(); rb.useGravity = false; rb.isKinematic = true; } // gameObject.tag = "Spaces"; } // Spawns robots in the centre of the first row of grid tiles. robots = new GameObject[num_robots]; for (int i = 0; i < num_robots; i++) { int spawn_pos = ((size_x / 2) - (num_robots / 2)) + i; robots[i] = Instantiate(robot_prefab, new Vector3(spaces[spawn_pos, 0].transform.position.x, 0.5f, spaces[spawn_pos, 0].transform.position.z), Quaternion.identity); robots[i].name = "Player " + (i + 1).ToString(); robots[i].transform.parent = spaces[spawn_pos, 0].transform; RobotData data_scr = robots[i].GetComponent <RobotData>(); data_scr.SetPlayerNum(i); RobotMovement move_scr = robots[i].GetComponent <RobotMovement>(); move_scr.x_pos = spawn_pos; } rob_mov = robots[0].GetComponent <RobotMovement>(); rob_mov2 = robots[1].GetComponent <RobotMovement>(); }
private void Move(RobotMovement movement) { switch (movement) { case RobotMovement.L: if (direction == RobotDirection.E) { direction = RobotDirection.N; } else { direction++; } break; case RobotMovement.R: if (direction == RobotDirection.N) { direction = RobotDirection.E; } else { direction--; } break; case RobotMovement.M: switch (direction) { case RobotDirection.N: y = y < MaxY ? y + 1 : y; break; case RobotDirection.W: x = x > MinX ? x - 1 : MinX; break; case RobotDirection.S: y = y > MinY ? y - 1 : MinY; break; case RobotDirection.E: x = x < MaxX ? x + 1 : x; break; default: break; } break; default: break; } }
void DropTile() { if (transform.GetChild(0).gameObject.tag == "Robot") { GameObject robot = transform.GetChild(0).gameObject; RobotMovement robot_scr = robot.GetComponent <RobotMovement>(); robot_scr.Fall(Mathf.RoundToInt(transform.position.x), Mathf.RoundToInt(transform.position.z)); AudioManager.instance.Play("tile_fall"); Destroy(this.gameObject); } }
public bool MoveRobot(int x_dir, int y_dir) { bool drive_sound = false; int x = x_pos + x_dir, y = y_pos + y_dir; if (!moving && !falling && !turning) { if (grid_script.CheckTile(x, y)) { // If tile is within the grid if (grid_script.GetTile(x, y).transform.childCount == 0) { // If tile is empty, move to tile Movement(x, y); if (!drive_sound) { AudioManager.instance.Play("drive"); drive_sound = true; } return(true); } else { if (grid_script.GetTile(x, y).transform.GetChild(0).gameObject.tag == "Robot") { // If tile is not empty, check if tile's child is robot RobotMovement robot_scr = grid_script.GetTile(x, y).transform.GetChild(0).gameObject.GetComponent <RobotMovement>(); if (robot_scr.MoveRobot(x_dir, y_dir)) { // If robot is pushed, move this robot to pushed robot's old position Movement(x, y); return(true); } return(false); } return(false); } } else { // If tile is not within grid fall off edge of the map Fall(x, y); return(true); } } AudioManager.instance.Stop("drive"); return(false); }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Player")) { RobotMovement robot = other.gameObject.GetComponent <RobotMovement>(); if (!robot.full) { robot.ObtainedGold(); Destroy(this.gameObject); } } }
void Awake() { gameController = GameObject.Find("GameController").GetComponent <GameController>(); fade = GameObject.Find("FadeCanvas").GetComponent <Fading>(); robot = GameObject.Find("Robot"); robotMovement = robot.GetComponent <RobotMovement> (); if (NetworkConnection.instance.replayMode == true) { this.gameObject.SetActive(false); fade.FadeIn(); } }
// Use this for initialization void Start() { animations = GetComponent <tk2dSpriteAnimator>(); movement = GetComponent <RobotMovement>(); smokeParticles = transform.GetChild(0).GetComponent <ParticleSystem>(); if (!smokeParticles) { Debug.LogError("Robot does not have smoke particles as a child"); } else { smokeParticles.enableEmission = false; } }
void OnDestroy() { if (!quitting && Network.isServer && !playerController.dontDestroy) { robot.SendMessage("setNeedsSelection", true); Pathfinder pathfinder = robot.GetComponent <Pathfinder>(); pathfinder.foundTarget = false; RobotMovement robotmovement = robot.GetComponent <RobotMovement>(); robotmovement.destroyTarget = false; GameObject levelcreator = GameObject.FindGameObjectWithTag("levelSettings"); Copy_LevelCreator levelSettings = levelcreator.GetComponent <Copy_LevelCreator>(); levelSettings.setGrid(Mathf.RoundToInt(this.transform.position.x), Mathf.RoundToInt(this.transform.position.y), Mathf.RoundToInt(this.transform.position.z), 0); } }
IEnumerator Explode() { hit = true; foreach (Renderer r in GetComponentsInChildren <Renderer>()) { r.enabled = false; } audio_source.clip = explosion; audio_source.Play(); RobotMovement robot_scr = target.GetComponent <RobotMovement>(); robot_scr.Respawn(); yield return(new WaitForSeconds(audio_source.clip.length)); Destroy(this.gameObject); }
// Use this for initialization void Start() { finished = false; pointToReach = ChoosingPointToReach(); sendingRays = SendingRays(); //noPath = false; targetFound = false; rC = GetComponent <RobotConnection>(); rDM = GetComponent <RobotDecisionMaking>(); rM = GetComponent <RobotMovement>(); rP = GetComponent <RobotProgress>(); rPl = GetComponent <RobotPlanning>(); rPl.range = rangeRays; landingRay.Add(new Ray(transform.position, Vector3.forward)); angle = angleRay; InitializeRays(); }
private void CopyMovements(object sender, MovementChangedEventArgs args) { RobotMovement[] movementsStack = new RobotMovement[args.MovementsStack.Length]; for (int i = 0; i < args.MovementsStack.Length; i++) { RobotMovement movement = args.MovementsStack[i]; RobotVector tPos = movement.TargetPosition; RobotVector tVel = movement.TargetVelocity; movementsStack[i] = new RobotMovement( targetPosition: new RobotVector(tPos.Y, tPos.X / 2.0, tPos.Z, robot2.HomePosition.ABC), targetVelocity: new RobotVector(0, 0, tVel.Z), targetDuration: movement.TargetDuration ); } robot2.MoveTo(movementsStack); }
private void okBtn_Click(object sender, EventArgs e) { DialogResult result = saveFileDialog1.ShowDialog(); if (result == DialogResult.OK) { RobotMovement movement = new RobotMovement { Id = Guid.NewGuid(), Name = nameTextBox.Text, RobotConfigurationId = ((RobotConfiguration)listBox1.SelectedItem).Id, Steps = new List <MovementStep>() }; Debug.WriteLine(saveFileDialog1.FileName); movement.Save(saveFileDialog1.FileName); } }
public GameObject GetFirst(int this_robot) { for (int i = size_y - 1; i >= 0; i--) { for (int j = 0; j < size_x; j++) { if (spaces[j, i].transform.childCount > 0) { if (spaces[j, i].transform.GetChild(0).gameObject != GetRobot(this_robot)) { RobotMovement robot_scr = spaces[j, i].transform.GetChild(0).gameObject.GetComponent <RobotMovement>(); if (robot_scr.CanTarget()) { return(spaces[j, i].transform.GetChild(0).gameObject); } } } } } return(null); }
void Start() { nodeGridInitialised = false; if (Network.isServer) { robotmovement = this.GetComponent <RobotMovement>(); nodeGrid = new Node[level.levelWidth, level.levelHeight, level.levelDepth]; for (int width = 0; width < level.levelWidth; width++) { for (int height = 0; height < level.levelHeight; height++) { for (int depth = 0; depth < level.levelDepth; depth++) { Node temp = new Node(width, height, depth); nodeGrid[width, height, depth] = temp; if (width > 0) { nodeGrid[width, height, depth].widthneg = nodeGrid[width - 1, height, depth]; nodeGrid[width - 1, height, depth].widthpos = nodeGrid[width, height, depth]; } if (height > 0) { nodeGrid[width, height, depth].heightneg = nodeGrid[width, height - 1, depth]; nodeGrid[width, height - 1, depth].heightpos = nodeGrid[width, height, depth]; } if (depth > 0) { nodeGrid[width, height, depth].depthneg = nodeGrid[width, height, depth - 1]; nodeGrid[width, height, depth - 1].depthpos = nodeGrid[width, height, depth]; } } } } } nodeGridInitialised = true; }
/// <summary> /// The method which runs every tick of the detection timer for detection of new gestures. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void detectionTick_Tick(object sender, EventArgs e) { if (isDetecting) { // Check for responses from Gesture Recogniser for Gesture Set One. if (cboxGestureSets.SelectedItem == boxGestureSet1) { if (skeletonData != null) { switch (newGesture.DetermineGesture(skeletonData, gestureSet)) { case "Hands Infront": lblGestureInfo.Content = "Gesture Detected - 'Hands Infront'"; AppendTextMain("Gesture detected - 'Hands Infront'\n"); AppendTextRovio("'Hands Infront' recieved:\n\tAccelerating Rovio...\n"); gestureDetected = true; currentMovement = RobotMovement.Accelerate; break; case "Hands Behind": lblGestureInfo.Content = "Gesture Detected - 'Hands Behind'"; AppendTextMain("Gesture detected - 'Hands Behind'\n"); AppendTextRovio("'Hands Behind' recieved:\n\tReversing Rovio...\n"); gestureDetected = true; currentMovement = RobotMovement.Reverse; break; case "Swipe Left (Right Hand)": lblGestureInfo.Content = "Gesture Detected - 'Swipe Left (Right Hand)'"; AppendTextMain("Gesture detected - 'Swipe Left (Right Hand)'\n"); AppendTextRovio("'Swipe Left (Right Hand)' recieved:\n\tRotating Rovio Left...\n"); gestureDetected = true; currentMovement = RobotMovement.RotateLeft; break; case "Swipe Right (Left Hand)": lblGestureInfo.Content = "Gesture Detected - 'Swipe Right (Left Hand)'"; AppendTextMain("Gesture detected - 'Swipe Right (Left Hand)'\n"); AppendTextRovio("'Swipe Right (Left Hand)' recieved:\n\tRotating Rovio Right...\n"); gestureDetected = true; currentMovement = RobotMovement.RotateRight; break; case "Left Hand Out": lblGestureInfo.Content = "Gesture Detected - 'Left Hand Out'"; AppendTextMain("Gesture detected - 'Left Hand Out'\n"); AppendTextRovio("'Left Hand Out' recieved:\n\tRovio Straight Left...\n"); gestureDetected = true; currentMovement = RobotMovement.StraightLeft; break; case "Right Hand Out": lblGestureInfo.Content = "Gesture Detected - 'Right Hand Out'"; AppendTextMain("Gesture detected - 'Right Hand Out'\n"); AppendTextRovio("'Right Hand Out' recieved:\n\tRovio Straight Right...\n"); gestureDetected = true; currentMovement = RobotMovement.StraightRight; break; case "Swipe Up (Right Hand)": lblGestureInfo.Content = "Gesture Detected - 'Swipe Up (Right Hand)'"; AppendTextMain("Gesture detected - 'Swipe Up (Right Hand)'\n"); AppendTextRovio("'Swipe Up (Right Hand)' recieved:\n\tRaising Rovio's Head...\n"); gestureDetected = true; currentMovement = RobotMovement.HeadUp; break; case "Swipe Down (Left Hand)": lblGestureInfo.Content = "Gesture Detected - 'Swipe Down (Left Hand)'"; AppendTextMain("Gesture detected - 'Swipe Down (Left Hand)'\n"); AppendTextRovio("'Swipe Down (Left Hand)' recieved:\n\tLowering Rovio's Head...\n"); gestureDetected = true; currentMovement = RobotMovement.HeadDown; break; case "Stop": lblGestureInfo.Content = "No Gesture detected"; gestureDetected = false; currentMovement = RobotMovement.Stop; break; default: lblGestureInfo.Content = "No Gesture detected"; gestureDetected = false; currentMovement = RobotMovement.Stop; break; } } txtCommands.ScrollToEnd(); } // end if (gestureSetOne) // Check for responses from Gesture Recogniser for Gesture Set Two if (cboxGestureSets.SelectedItem == boxGestureSet2) { if (skeletonData != null) { switch (newGesture.DetermineGesture(skeletonData, gestureSet)) { case "Joystick position set (Right Hand)": AppendTextMain("Joystick Position Set! (Right Hand)\n"); lblGestureInfo.Content = "Joystick Position Set! (Right Hand)!"; isJoystickRightSet = true; break; case "Joystick position set (Left Hand)": AppendTextMain("Joystick Position Set! (Left Hand)\n"); lblGestureInfo.Content = "Joystick Position Set! (Left Hand)!"; isJoystickLeftSet = true; break; case "JoystickRight Reset": AppendTextMain("Joystick Position Reset (Right Hand)\n"); lblGestureInfo.Content = "Joystick Position Reset (Right Hand)"; isJoystickRightSet = false; break; case "JoystickLeft Reset": AppendTextMain("Joystick Position Reset (Left Hand)\n"); lblGestureInfo.Content = "Joystick Position Reset (Left Hand)"; isJoystickLeftSet = false; break; case "Joystick Right Up": AppendTextMain("Gesture Detected - 'Joystick Right Up'\n"); AppendTextRovio("'Joystick Right Up' recieved:\n\tAccelerating Rovio...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Right Up'"; gestureDetected = true; currentMovement = RobotMovement.Accelerate; break; case "Joystick Right Down": AppendTextMain("Gesture Detected - 'Joystick Right Down'\n"); AppendTextRovio("'Joystick Right Down' recieved:\n\tReversing Rovio...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Right Down'"; gestureDetected = true; currentMovement = RobotMovement.Reverse; break; case "Joystick Right Left": AppendTextMain("Gesture Detected - 'Joystick Right Left'\n"); AppendTextRovio("'Joystick Right Left' recieved:\n\tRovio Straight Left...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Right Left'"; gestureDetected = true; currentMovement = RobotMovement.StraightLeft; break; case "Joystick Right Right": AppendTextMain("Gesture Detected - 'Joystick Right Right'\n"); AppendTextRovio("'Joystick Right Right' recieved:\n\tRovio Straight Right...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Right Right'"; gestureDetected = true; currentMovement = RobotMovement.StraightRight; break; case "Joystick Left Left": AppendTextMain("Gesture Detected - 'Joystick Left Left'\n"); AppendTextRovio("'Joystick Left Left' recieved:\n\tRotating Rovio Left...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Left Left'"; gestureDetected = true; currentMovement = RobotMovement.RotateLeft; break; case "Joystick Left Right": AppendTextMain("Gesture Detected - 'Joystick Left Right'\n"); AppendTextRovio("'Joystick Left Right' recieved:\n\tRotating Rovio Right...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Left Right'"; gestureDetected = true; currentMovement = RobotMovement.RotateRight; break; case "Joystick Left Up": AppendTextMain("Gesture Detected - 'Joystick Left Up'\n"); AppendTextRovio("'Joystick Left Up' recieved:\n\tRotating Rovio Right...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Left Up'"; gestureDetected = true; currentMovement = RobotMovement.HeadUp; break; case "Joystick Left Down": AppendTextMain("Gesture Detected - 'Joystick Left Down'\n"); AppendTextRovio("'Joystick Left Down' recieved:\n\tRotating Rovio Right...\n"); lblGestureInfo.Content = "Gesture Detected - 'Joystick Left Down'"; gestureDetected = true; currentMovement = RobotMovement.HeadDown; break; case "Stop": lblGestureInfo.Content = "No Gesture detected"; gestureDetected = false; currentMovement = RobotMovement.Stop; break; default: if (isJoystickRightSet == true) { lblGestureInfo.Content = "Joystick position set (Right Hand)!"; } else if (isJoystickLeftSet == true) { lblGestureInfo.Content = "Joystick position set (Left Hand)!"; } else { lblGestureInfo.Content = "No Gesture detected"; } gestureDetected = false; currentMovement = RobotMovement.Stop; break; } txtCommands.ScrollToEnd(); } // end if (skeletondata) } // end if (gestureSetTwo) if (cboxGestureSets.SelectedItem == boxGestureSet3) { if (skeletonData != null) { switch (newGesture.DetermineGesture(skeletonData, gestureSet)) { case "Lever Positions Set": AppendTextMain("Lever Positions Set!\n"); lblGestureInfo.Content = "Lever Positions Set!"; isLeverSet = true; break; case "Lever Positions Reset": AppendTextMain("Lever Positions Reset.\n"); lblGestureInfo.Content = "Lever Positions Reset."; isLeverSet = false; break; case "Punch Both Hands": AppendTextMain("Gesture Detected - 'Punch Both Hands'\n"); lblGestureInfo.Content = "Gesture Detected - 'Punch Both Hands'"; gestureDetected = true; currentMovement = RobotMovement.Accelerate; break; case "Pull Both Hands": AppendTextMain("Gesture Detected - 'Pull Both Hands'\n"); lblGestureInfo.Content = "Gesture Detected - 'Pull Both Hands'"; gestureDetected = true; currentMovement = RobotMovement.Reverse; break; case "Punch Left": AppendTextMain("Gesture Detected - 'Punch Left'\n"); lblGestureInfo.Content = "Gesture Detected - 'Punch Left'"; gestureDetected = true; currentMovement = RobotMovement.StraightLeft; break; case "Punch Right": AppendTextMain("Gesture Detected - 'Punch Right'\n"); lblGestureInfo.Content = "Gesture Detected - 'Punch Right'"; gestureDetected = true; currentMovement = RobotMovement.StraightRight; break; case "Punch Right Pull Left": AppendTextMain("Gesture Detected - 'Punch Right, Pull Left'\n"); lblGestureInfo.Content = "Gesture Detected - 'Punch Right, Pull Left'"; gestureDetected = true; currentMovement = RobotMovement.RotateLeft; break; case "Punch Left Pull Right": AppendTextMain("Gesture Detected - 'Punch Left, Pull Right'\n"); lblGestureInfo.Content = "Gesture Detected - 'Punch Left, Pull Right'"; gestureDetected = true; currentMovement = RobotMovement.RotateRight; break; case "Raise Left Hand": AppendTextMain("Gesture Detected - 'Raise Left Hand'\n"); lblGestureInfo.Content = "Gesture Detected - 'Raise Left Hand'"; gestureDetected = true; currentMovement = RobotMovement.HeadDown; break; case "Raise Right Hand": AppendTextMain("Gesture Detected - 'Raise Right Hand'\n"); lblGestureInfo.Content = "Gesture Detected - 'Raise Right Hand'"; gestureDetected = true; currentMovement = RobotMovement.HeadUp; break; case "Stop": lblGestureInfo.Content = "No Gesture detected"; gestureDetected = false; currentMovement = RobotMovement.Stop; break; default: if (isLeverSet == true) { lblGestureInfo.Content = "Lever Position Set"; } else { lblGestureInfo.Content = "No Gesture detected"; } gestureDetected = false; currentMovement = RobotMovement.Stop; break; } // end switch txtCommands.ScrollToEnd(); } // endif (skeletonData) } // endif (gestureSetThree) }// endif (isDetecting) }