![]() You can read about it more on the parallax Wikipedia page. This is referred to as parallax or motion parallax. This effect is a cue to your visual system and brain that the objects that more more are closer, and the objects that move less areįarther away. If you pay close attention, You'll notice that the some components on the canvas move more than others as the mouse moves. The components of the landscape move left/right. Similarly, when the mouse moved left/right (x axis), the perspective follows. The components of the landscape move upwards/downwards. When the mouse moved up/down (y axis), the perspective follows. Motion Parallax As you can see in the example, the perspective of the landscape changes as the mouse moves. You should not have any functions with more than 5 parameters, or that return more than 5 values. For example, you might create one function to draw the birds, another function to draw the foreground, etc. You should create a function for each visual component/ category in the program. ![]() The only code that is allowed to not be in a function are your import statements and call to main(). You should structure all of the code into functions. Program Structure This program must follow the style guidelines. Thus, you should be careful to make sure your program behaves very similar to the examples that are shown on this spec. The TAs will grade submissions by trying to run your programs. Also, there will be not autograder tests on Gradescope for this. This program does not take any input values from the command-line, and does not need to print anything on the command-line either. You can refer to the slides from section if you forgot how to work with the graphics module. Remember to put graphics.py in the same directory as motion_parallax.py. All of the graphics should be displayed using the graphics.py module. You are welcome to add additional things to the landscape: clouds, sun rays, other foliage, snow caps on the mountains, etc.You should also use a loop to repeat the birds. There should be 5 birds that repeatedly fly across the screen.You may want to use the get_color_string function to help you go from random numbers to a valid color string. Thus, each time the program is executed, you may get different colors than the previous time the program was run. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |