LibGdx Spaceship Scrolling Game 27: Changing User Input and Improving Performance
- Details
- Category: Developing a spaceship scrolling game using LibGdx
- Hits: 1624
In this video tutorial the user input is changed from Left-Right directional buttons only to a 360 degrees free style movement. This is done by creating a new class that represents a circular button. A circular image is used to represent the button itself. When the screen is being touched, the distance from the touch to the center of the button is calculated, and used to figure out if the user is touching the button. Next based on the touch location the angle relative to the center of the button is calculated and is used to move the spaceship.