Skip to content

Commit ff32920

Browse files
authored
Update readme.md
1 parent 3a68cc4 commit ff32920

File tree

1 file changed

+11
-0
lines changed
  • Python Projects/Intermediate Games/SketchBook

1 file changed

+11
-0
lines changed

Python Projects/Intermediate Games/SketchBook/readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Live Demo
2+
23
https://user-images.githubusercontent.com/67270567/226549542-cd786152-fcb2-43f9-ba1d-6d6994775f33.mp4
4+
35
Press the Play button to See the Output
46

57
# Line by Line Explanation of the Code
@@ -86,3 +88,12 @@ The code sets up an event listener using the `listen()` method on the window obj
8688
- When the `a` key is pressed, the `move_left()` function is called.
8789
- When the `d` key is pressed, the `move_right()` function is called.
8890
- When the `c` key is pressed, the `clear()` function is called.
91+
92+
```python
93+
window.exitonclick()
94+
```
95+
7. Exiting the Program
96+
97+
The` exitonclick()` method is called on the window object to keep the window open until the user clicks on it, allowing them to view their drawings.
98+
99+
8. In summary, the code sets up a simple drawing application that allows users to move a turtle around the screen and create drawings using basic keyboard input. It sets up event listeners to detect keyboard input, and responds to the input by calling specific functions to control the turtle's movement. The `clear()` function is defined to clear the screen, and the `exitonclick()` method is used to keep the window open until the user clicks on it.

0 commit comments

Comments
 (0)