After a few tries I figured out that if you just go in a corner after you catch the red cube, the green cube will never hit you, so the game becomes a routine and you just move from a corner to the middle beacuse you know what cube will spawn next. The game needs a little randomness.