Previous:Completing the game code
Moving the collect box
Our game only collects boxes. A box falls from the same position and falls down to the same x position. This doesn't well represent our intention for the game. We can now advance our game to allow us
1. Move the box at the bottom to be able to collect box at any x position.
2. Vary the position x from where the box is dropped to increase difficulty. This would end up defining our levels.
The main focus now is ability to move the bottom box to the right or left. We are developing for android and hence we can utilize the touch setting of android devices. When user swipes to the right or left, our box should move to the same direction. This can be achieved by changing the x position of the box at the bottom. We need to check if the user just tapped or they swiped. This way you can move on swipe and no action, for now, on tap.
To also make the game more interesting, we will now generate box from any random position. We also need to check whether the box is collected or not.
1. We move box by swipe right or left.
2. Determine if box is collected or not by introducing floor where if the box fall on it, we missed it.
3. Generate the box from random point
Next: Marketing tips