This question is a continuation of a question originally posted [here](https://stackoverflow.com/questions/66596773/increase-javafx-keyframe-speed-without-cyclic-dependency).

> 
> I'm trying my hand at creating a Snake clone with JavaFX. One of the
> requirements for the game is to have a sort of powerup food, which
> increases the velocity of the snake.
> 
> 
> For my game loop, I'm using a `Timeline` with a single `KeyFrame`,
> which acts as the game tick. Every game object is rendered onto a
> `Canvas`.
> 
> 
> 

To increase the velocity of the game, I currently stop the timeline and recreate its keyframe with a shorter duration.

The problem, however, is that the instance methods to do so are in class `Game`, but the caller is an instance of `State`, which `Game` has instantiated.

Is there a way to avoid a cyclic dependency here, but also keep it elegant? I'm open to redesigning the architecture.