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

New LEGO MindStorms – Exploration Rover Model Analysis

In the new released LEGO MindStorms, its app contains multiple models. Some models come from LEGO Community. In today's post, let's build one model and analyze its structure. You could find this model from LEGO app shown as below. Model Structure This model is pretty big and heavy. Its body is widely stretched and symmetric. …

Continue reading New LEGO MindStorms – Exploration Rover Model 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

Learn Scratch 3.0 by Analyzing Project – Melting Line Puzzle Game Part 2

In the last post, I analyzed those UI related sprite of the Melting Line puzzle game. In this post, I would like to introduce the list structure and how to judge pass/fail condition of the game. All of these functions are implemented by Algorithm Sprite. Algorithm Sprite "when I receive start a level" Code Segment …

Continue reading Learn Scratch 3.0 by Analyzing Project – Melting Line Puzzle Game Part 2

Learn Scratch 3.0 by Analyzing Project – Melting Line Puzzle Game Part 1

In the previous posts, I analyzed many puzzle projects, such as Gliding Puzzle, Game 2048, Tetris, etc. There is much difference between puzzle game and other popular Scratch games. Puzzle games usually have static background and focus less on sprite's costume and actions. Therefore, some players might feel that puzzle games are not so shiny. …

Continue reading Learn Scratch 3.0 by Analyzing Project – Melting Line Puzzle Game Part 1

Scratch 3.0 – Several Tools to Enhance the Visual Effect of Your Game

If you are a new Scratcher, you might wonder how to use your own pictures to create unique visual effect. After all, it is a bit boring and mundane if we only use the images from the libraries. In this post, I would like to introduce a few tools which are pretty common to help …

Continue reading Scratch 3.0 – Several Tools to Enhance the Visual Effect of Your Game