Skip to content

Instantly share code, notes, and snippets.

@cesarizu
Created September 21, 2014 03:59
Show Gist options
  • Save cesarizu/d94445e51c8ba9f5aac9 to your computer and use it in GitHub Desktop.
Save cesarizu/d94445e51c8ba9f5aac9 to your computer and use it in GitHub Desktop.
package org.caih.juggler.elements
import aurelienribon.tweenengine.TweenAccessor
class BallAccessor implements TweenAccessor<Ball> {
public static final int POS_Y = 0
@Override
int getValues(Ball ball, int i, float[] floats) {
switch (i) {
case POS_Y:
return ball.bounceY
default:
return 0
}
}
@Override
void setValues(Ball ball, int i, float[] floats) {
switch (i) {
case POS_Y:
ball.bounceY = floats[0]
break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment