I'm having trouble finding the best way to set up animations with conflict detection. I have a fully functional version of falldown (a popular game with a calculator) that uses a handler and onDraw () to draw rectangles for strings and a raster ball. However, this animation skips (it looks laggy), and so I'm trying to switch the animation to animation animation.
My question is conceptual: how to detect collisions in the middle of an animation? I see a side animation taking one of two routes: a) I am animated with very small steps. However, I think it will look as bad as the current animation setting. b) I set the animation entirely to the left or right of the screen, but each step in the animation checks that the ball does not pass through the line.
I am facing a similar problem with the downward movement of the ball. Is it possible to constantly get / update the position of the ball (stored as an integer) and then shorten the animation short if it encounters something? Is it possible for the ball to be animated down if and only if it is not above a piece of string? There must be some way to detect collisions inside the animation, but I don't know how to do this.
edit: if the animation class is not suitable for games, how can I revive my game? Like I said, the ondraw handler system that I force passes the ball even when I set the delay to 1 millisecond.
source
share