Introduction
This is basically an interactive graphics project.
Use graphics.py.
It is a simple graphics library.
Click HERE
for more information.
(download, install, documentation, ...)
Project #0
In a graphics window, recreate the image below using squares.
Project #1
Create a program that
allows the user to grab, drag, and stack
objects (circles, squares, triangles)
in a graphics window.
- 3 or 4 predefined objects of various sizes and shapes
- solid objects of different colors
- predefined stacking order
- objects can be partly obscured by objects above them
- the stacking order can be modified
- change the location of objects
Project #2
allow the user to
- change an objects color?
- add/delete objects?
- change an object's size?
- change an object's shape?
Project #3
Do project #1 or #2 with pygame?
Design thoughts and questions
Just be cause you can think it does not
mean you should do it. Keep it simple. (KISS principal)
- use a menu or buttons on the screen or both
- maintain a list of objects in depth order
- when a change is made redraw the objects
in the list
- don't bother to redraw objects that don't change
- what are your thoughts?
Links
Z-buffering
(Wikipedia)