This is a project that will give you an idea as to how a kaleidoscope works. Use keys Left and Right to move the triangles, and use the Forward and Backward arrows to draw.
Scratch.mit.edu