Libraries & Animation


In the first week, you were introduced to state. In the second week, you were introduced to iteration, one of the more difficult programming constructs to grasp. In the third week, we discussed another programming construct: selection. In week four, we reinforced these topics while incorporating file handling. In week five, we used functions to produce organised, maintainable solutions. Last week, we started to look at creating programs that use graphics. This week, we will build on last week and this week's study of the Tkinter library to create a simple retro snake game that uses animation, key binding and collision detection.

If you think you can build this game without assistance, try this now. If you would like some assistance, then work through this lab script. By the end, you will have created your own snake game and you will have experience implementing features that are required in your Tkinter coursework!

image





Click here to go to the COMP16321 Blackboard page


Click anywhere to close this video

Contents




Green = Current Page

Click anywhere to close this overlay

Topics Covered in this Lab



1. Tkinter basics

2. Canvas function

3. Key bindings

4. Canvas placement

5. Tkinter movement

6. Collision detection



Click anywhere to close this overlay

Lab Key



Notes – #FF6F61

Videos – #34568B

Code Examples – #009B77

Downloads - #C3447A

Internal Link (University Resources) – #955251

External Link (Non-University Resources)– #EFC050

Other - #660099



Click anywhere to close this overlay