Pygame is a game development platform for python that handles a lot of the basic plumbing you need to implement in basic 2D or tile-based games.
There are also quite a few tutorials (and books!) out there to help you get started with pygame, with some of the following being a good starting point:
Be sure to see our Using the WebIDE tutorial for info on how to create a new file in the WebIDE.
Once you're up and running with the WebIDE, create a new project folder in my-pi-projects named 'pyscope'. Once you're inside this folder, create a file named 'pyscope.py'