Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

For making a bottle to spin, I focused first on the touch dragging via input processor interface. It's a bit unresponsive since when I rotate clockwise or counter-clockwise as long as my finger follows. Did I make it right or not? Take note that I'm using only the input processor interface and not the gesture listener interface. Below here is the code that I set under touchDragged(int screenX, int screenY, int pointer)

    rotate = (float) -(Math.atan2((Gdx.input.getX()/2)-(sprite.bottle.getX()/2), -(Gdx.input.getY()-sprite.bottle.getY())) * 180.0d/Math.PI);
    sprite.bottle.setRotation(rotate);
    sprite.bottle.setOrigin(155, (1280/2) - (adjust.bottle.height/2));

The code seems right but the issues is on the screen's resolution where it held the total range of X and Y coordinate values as designated for degrees. Let's say "Cartesian resolution" mathematically and technically where designates quadrant. On a small screen (420x580), it rotates smoothly; either clockwise or counter-clockwise, it follows realistically. However, in a big screen (720x1280 resolution, HD), the bottle spins either slowly or suddenly jumps at between quadrant I and II as the bottle spins so fast like a slippery butter.

Also, will the fling code work or respond at the touchUp(int screenX, int screenY, int pointer, int button)? Bottle rotates while dragging with my finger. Bottle flings and spins depending on the speed or force applied to my finger gesture right, only if after when my finger lifted from the screen?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.