It functions with no issues. The concept is extremely awesome and could be made into a really fun arcade game if explored further. Maybe an arrow on the red X to indicate its next direction, or a bonus for constantly tracking the black X.
I hope you revisit this idea or continue to improve upon it.