It looks like my old thread disappeared, so here's a new one for all the coders out there. Use this thread for anything relating to programming, especially if you're looking for help. Speaking of which...
I'm in the middle of tweaking a game I made for Windows 7 phones using XNA, and I'm trying to make the controls more precise. In my game, I move a ball around by sliding the cursor (I'm using the phone emulator). Currently, there are a few problems:
I'm in the middle of tweaking a game I made for Windows 7 phones using XNA, and I'm trying to make the controls more precise. In my game, I move a ball around by sliding the cursor (I'm using the phone emulator). Currently, there are a few problems:
- The ball moves a bit too much when I make even slight movements
- If I slide in a direction when the cursor is not on the ball, the ball will move in that direction. The ball should move only when the cursor is on the ball.
Spoiler:
protected override void SetupInputs() //TODO: make controls good! { float slideDistance = 20.0f; //Code for sliding to the left input.AddTouchSlideInput(ActionMoveLeft, Input.Direction.Left, slideDistance); //input.AddTouchGestureInput(ActionMoveRight, GestureType.Tap, ScreenRightHalf); //Code for sliding to the right input.AddTouchSlideInput(ActionMoveRight, Input.Direction.Right, slideDistance); //input.AddTouchGestureInput(ActionMoveLeft, GestureType.Tap, ScreenLeftHalf); //Code for sliding up input.AddTouchSlideInput(ActionMoveUp, Input.Direction.Up, slideDistance); //Code for sliding down input.AddTouchSlideInput(ActionMoveDown, Input.Direction.Down, slideDistance); //Code for restarting level input.AddTouchGestureInput(ActionRestart, GestureType.Tap, restartButton.TouchArea); }