Python Programming: Use Turtle Library to Realize Animation

In the previous post, I use Scratch 3.0 to create animation with Pen functionality. Could we do the same thing using Python? Definitely Yes. We could use Turtle library to generate the same effect, but with more concise code structure. In this post, Let me introduce how to implement it. If you would like to …

Continue reading Python Programming: Use Turtle Library to Realize Animation

Analyze Python Project – Integrate Tkinter and Turtle and Respond to Mouse and Keypress

In previous posts, I introduced some sample projects from Pygame installation folder. Besides Pygame, Turtle and Tkinter modules are also popular for Python learning beginners. Tkinter package is a standard Python interface to Tk GUI toolkit. It could design window and different widgets, such as button, textbox, label, canvas and handle the interaction with user …

Continue reading Analyze Python Project – Integrate Tkinter and Turtle and Respond to Mouse and Keypress

Analyze PyGame Example Project – Music_drop_fade.py – Part 2

In the previous post, I introduced the first part of the project Music_drop_fade.py. It defines functions that would be called by main() function. In this post, I will introduce the main() function and wrap up the whole project. So let's start now! The main() function starts at line 148. It first defines several global variables …

Continue reading Analyze PyGame Example Project – Music_drop_fade.py – Part 2

Analyze PyGame Example Project – Music_drop_fade.py – Part 1

https://videopress.com/v/Ipyl5MiD?preloadContent=metadata In this post, I would like to analyze another Python sample project. Its function is to play the music file when dragging and dropping them to the project window. The program could also respond to different keys to change volume, play forward or rewind. Those functions have being listed at the header section of …

Continue reading Analyze PyGame Example Project – Music_drop_fade.py – Part 1

Analyze PyGame Example Project – Star.py

If you have interest in learning game development with PyGame, you might wonder where you could find sample projects for you as a reference. Actually, after you install PyGame module on your computer, PyGame automatically installs some projects for you. So where could you find those sample projects? You could use the following method to …

Continue reading Analyze PyGame Example Project – Star.py

Design Puzzle Game “Eight Queens” with PyGame – A Detailed Code Analysis

In previous post, I introduced how to use PyGame to convert a Scratch project into a Python project. If you are interested in that project, you could refer to this post: Forest Maze. In today's post, I would like to introduce another project written in Python and run on PyGame. Compared to previous project, this …

Continue reading Design Puzzle Game “Eight Queens” with PyGame – A Detailed Code Analysis

Convert Scratch 3.0 Game to Python Game – Part 1

In the previous post, I introduced a simple game: Catch Butterfly. It uses Python Pygame framework to create a 2D interactive game. You might have noticed that using Pygame seems not an easy task. However, if you get familiar with Pygame structure and functions, even more complicated game is not a problem. In this post, …

Continue reading Convert Scratch 3.0 Game to Python Game – Part 1

Use Python Pygame to Create Game

Students who learned Python for the first time might notice the difference between Scratch and Python. They could write with Python’s built-in functions and deal with the interaction with end user only through the print() and input() functions. Sometimes, it is a bit boring since no any graphical interface is included. Some might ask if …

Continue reading Use Python Pygame to Create Game