Look at the clouds, and you will know how many spells to cast.
If you play with a keyboard:
To walk and jump, use the arrow keys.
To shoot a spell, press space.
To shoot a spell that removes previous spells, hold space until the magic ball turns yellow.
To get help calculating a number, click the cloud numbers.