Press Space to swing the sword. Hitting the colorful spheres with your sword will give you points but if you miss them, they will hit the red line and you will loose health. Gaining 20 points would make you win the game but if you loose 10 health points, you loose.
https://www.ebay.com.au/itm/402437954182 for the sword.