Tetris blocks movement with touch
Hi, I am making a game similar to tetris. Right now I am having problem with the way the blocks are moving using touch. I want to have them move right or left at a specific interval (size of each grid). My logic so far is to detect if a finger move a certain distance in x or -x direction, and if it did, the block would jump one grid left or right. However, The problem is when player wants to move the block more than one grid one direction, the control does not feel smooth at all.
So the natural motion for wanting to move a block across the game grid usually end up being a swipe motion rather than moving you finger across the board. The swipe motion often does not produce enough finger movement distance that the block would only move 2-3 grids in the direction of the swipe instead of moving across the entire game board. I was wondering if anyone have a better idea of how to implement this logic. Thanks.
What do you mean by
The swipe motion often does not produce enough finger movement distance
If you take the distance and multiply it by 10 before using it for moving the blocks they would move 20 - 30 grids, right?
Answer by Beastofeast · Jan 25, 2016 at 06:35 PM
What I mean is that, for me at least the faster you swipe, the more it feels like a flick, and in that case the time you move your finger while it's on the screen is shorter hence the shorter distance registered by iphone.
I cloud multiply the distance by10 when swipe is detected, but then each swipe would be the same, I want to respond to the speed of the swipe, to make it more natural and smooth.
Your answer
Follow this Question
Related Questions
How to detect Double Tap in Android 12 Answers
Untiy released to the web can support multi touch it? 0 Answers
Tetris grid 1 Answer
How can I detect touch on a Mesh Collider on an Android device ? 3 Answers
TouchScript Library - Continually (by frame or change of position) get touch position 0 Answers