Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double rotation = angle - lastAngle;
- selectedMob.rotate((float) (rotation));
- public void rotate(float angle) {
- this.angle += angle;
- }
- double rads = Math.atan2(dy, dx);
- double angle = Math.toDegrees(rads);
- 09-13 00:03:53.708: V/GameActivity(23389): updating frame
- 09-13 00:03:53.708: V/GameActivity(23389): checked for all mobs
- 09-13 00:03:53.825: V/GameActivity(23389): Angle of finger is 360.0
- 09-13 00:03:53.825: V/GameActivity(23389): Angle of mob is 344.94818
- 09-13 00:03:53.825: V/GameActivity(23389): Last angle is 359.56921278299137
- 09-13 00:03:53.825: V/GameActivity(23389): Rotation will be 0.43078721700862843
- 09-13 00:03:53.825: V/GameActivity(23389): ****************
- 09-13 00:03:53.825: V/GameActivity(23389): updating frame
- 09-13 00:03:53.825: V/GameActivity(23389): checked for all mobs
- 09-13 00:03:54.137: V/GameActivity(23389): Angle of finger is 0.4275725068334077
- 09-13 00:03:54.137: V/GameActivity(23389): Angle of mob is 345.37897
- 09-13 00:03:54.137: V/GameActivity(23389): Last angle is 360.0
- 09-13 00:03:54.137: V/GameActivity(23389): Rotation will be -359.5724274931666
- 09-13 00:03:54.137: V/GameActivity(23389): ****************
- while(Math.Abs(angle - lastAngle) > 180)
- angle += (angle > lastAngle ? -360 : 360);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement