Blogs

Follow Our Future Articles

Get new content delivered directly to your inbox.

Use PyInstaller to Create Executable of Python PgZero Game – Windows Version

If you develop a game with Pgzero or PyGame, you might want to invite your friends to play it. However, some of your friends do not use Python, so they do not have the Python development environment, or you do not want to share your Pgzero code at that moment. How do you wrap your …

Continue reading Use PyInstaller to Create Executable of Python PgZero Game – Windows Version

Code Structure Change When Converting Blockly Language into Pyton Code for LEGO MindStorms

When we start to write Python code for LEGO MindStorms models, we tend to convert existing Scratch blockly code into Python version and check if it works. Although LEGO has made effort to create Python methods which could match the functionality of Scratch programming blocks, the Python code structure is much different from that of …

Continue reading Code Structure Change When Converting Blockly Language into Pyton Code for LEGO MindStorms

Use LEGO MindStorms Inventor to Create a Rolling Pattern – With Python

As we know, LEGO MindStorms Inventor provides animation functionality. In the Animation Editor, we could specify the light matrix pattern, then call the “play animation” block to play it. However, how about we want a pattern rolling freely on the light matrix? just like what the below video shows. We could not use the built-in …

Continue reading Use LEGO MindStorms Inventor to Create a Rolling Pattern – With Python

How to Store and Run Multiple Programs on LEGO MindStorms Inventor or Spike

If you have a LEGO MindStorms Inventor or Spike Prime set, you might wonder how to store multiple programs to the smart hub and then switch to the program you want to run. In this post, I will demonstrate how to download and store multiple programs. Now I have a project called “pet dog”, as …

Continue reading How to Store and Run Multiple Programs on LEGO MindStorms Inventor or Spike

Use LEGO MindStorms Inventor to Build a Pet Dog – Code it with Both Blockly Language and Python – Part Two

In the previous post, I introduced how to use blockly language to control LEGO MindStorms Inventor, and write code for the pet dog. As I have already mentioned, we could accomplish the similar functionalities by using Python. In today’s post, we will use the Python editor of LEGO MindStorms Inventor App to implement the same …

Continue reading Use LEGO MindStorms Inventor to Build a Pet Dog – Code it with Both Blockly Language and Python – Part Two

For Those Who Could Not Run MakeCode for Maqueen Plus 2.0, here is the Solution

If you bought the Maqueen Plus 2.0 recently, you might meet the same issue which I encountered. I spent several hours trying to make it work, but it seemed the motors were not working properly at all. The program could not control either the movement direction and speed of the motors. The most possible reason …

Continue reading For Those Who Could Not Run MakeCode for Maqueen Plus 2.0, here is the Solution

Use LEGO MindStorms Inventor to Build a Pet Dog – Code it with Both Blockly Language and Python – Part One

If you once played the LEGO MindStorms EV3, you might have built one of its sample projects Puppy, which I explained in my previous posts. Several years ago, when EV3 has not yet supported the Scratch blockly language, the puppy code is pretty complicated and confusing. In this post, I will use LEGO MindStorms Inventor …

Continue reading Use LEGO MindStorms Inventor to Build a Pet Dog – Code it with Both Blockly Language and Python – Part One

Coding Micro:bit with Python – Which Python Editor to Choose From?

If you feel that LEGO robot is too expensive, you have another choice micro:bit. There are several editors we could use to code micro:bit. What are their differences and which one is better if we want to code micro:bit with Python? In this post, I would like to compare briefly several editors for micro:bit. The …

Continue reading Coding Micro:bit with Python – Which Python Editor to Choose From?

Use LEGO MindStorms Smart Hub to Design a Dodge Game – This Time Using Python

This post is closely related to my previous post – use LEGO MindStorms Smart Hub to design a dodge game. The difference is that in this project, I will use Python to implement the same functionality as I did in the previous post. If you are interested, you could open the two posts side by …

Continue reading Use LEGO MindStorms Smart Hub to Design a Dodge Game – This Time Using Python

Use LEGO MindStorms Smart Hub to Design a Dodge Game – Refer to a Micro:bit Sample Project

Recently, we have been exploring Micro:bit and its huge eco-system to see if we could bring some high-quality lessons to our existing workshop portfolio. Honestly, I am amazed by the Micro:bit eco-system. It is compatible to large amount of hardware, especially the sensors. Soon, I will update a post about the comparison between Micro:bit and …

Continue reading Use LEGO MindStorms Smart Hub to Design a Dodge Game – Refer to a Micro:bit Sample Project

First Experience of CoderZ and Comparison between Cyber Robotics and Physical Robotics

The first sight of CoderZ gave me the impression that it was teaching some simple operations of turning and moving, as well as math calculation, especially when I do the activities in its trial lesson CoderZ Adventure with LEGO Education Spike Prime. If that is the case, the difference between cyber robotics and physial one …

Continue reading First Experience of CoderZ and Comparison between Cyber Robotics and Physical Robotics

Find Maximum Prime Factor of a Number by Using Python – Algorithm Explanation

Recently, I am teaching students algorithm using Python. One question is to find maximum prime factor of a given number. When we consider algorithm, we should consider both the running time and occupied memory of the program when the input is an extremely big number. The following algorithm is very typical to get the prime …

Continue reading Find Maximum Prime Factor of a Number by Using Python – Algorithm Explanation

A Method to Encrypt the Answer in Scratch Programming

If you are designing a quiz project in Scratch, you will check if the user could answer the questions correctly. However, since all the published projects share the code, your user could always “see inside” of the project and get the answer, like the following code snippet. How could you test your user without getting …

Continue reading A Method to Encrypt the Answer in Scratch Programming

PyGame is too complicated? Try PgZero

In my previous posts, I introduced how to use PyGame to design 2D games with Python language. Pygame adds functionality on top of the excellent SDL library. User controls the main loop, designs their program functions and different sprites’ interaction. This gives user greater control in creating fully featured games and multimedia programs in the Python …

Continue reading PyGame is too complicated? Try PgZero

Which Apps Should I Use for LEGO Robots?

Recently, LEGO has updated its robotics software, especially for the products of LEGO MindStorms EV3 and LEGO MindStorms Inventor. Facing so many apps, you might wonder which apps you should install and what are their differences? In this post, I will introduce the apps of three LEGO robots, their download positions and differences. LEGO MindStorms …

Continue reading Which Apps Should I Use for LEGO Robots?

From PyGame to GoDot – What’s Their Difference?

About PyGame If you would like to use Python to develop 2D game, your first choice might be PyGame, which is popular among Python game developers. Go to the website https://www.pygame.org/docs/ref/key.html, you could browse all of the classes and their explanation. All of the stuffs are grouped into the pygame library. If you do not …

Continue reading From PyGame to GoDot – What’s Their Difference?

Use PyGame to Create Tetris Game – An Updated Version Part 2

In my previous post, I introduced the first part of Tetris game written in Python. Today, let’s continue the left part of the code. In the first part, we have introduced the class Piece and several functions which will be used by the main() function. Now, let’s see what the main() function is doing. Starting …

Continue reading Use PyGame to Create Tetris Game – An Updated Version Part 2

Use PyGame to Create Tetris Game – an Updated Version

In the previous posts, I once analyzed a Tetris game developed in Scratch. It uses Pen drawing tab to draw all the tetris pieces. However, due to the limitation of data structure in Scratch, the code structure is super complicated compared to other Scratch projects. How about we implement it in Python? On YouTube, some …

Continue reading Use PyGame to Create Tetris Game – an Updated Version

Learn Scratch by Analyzing Others’ Project – Platformer Game with Editing Functionality Part 4

In the previous posts, I introduced the core sprite of the Blocky game, the “Blocks” sprite, which is responsible for adding, deleting or editing the environment blocks. Starting from this post, we are going to switch to the other core sprite – Hitbox. Homescreen UI Sprite Before introducing the code of Hitbox sprite, I would …

Continue reading Learn Scratch by Analyzing Others’ Project – Platformer Game with Editing Functionality Part 4

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

Learn Scratch by Analyzing Others’ Project – Platformer Game with Editing Functionality Part 3

In the previous post, I introduced part of the Stamp block. As I have said, this is a very long code segment and its functionality could be divided into three parts. In the previous Part 2 analysis, I analysed the first functionality – drawing the blocks on the stage. In this post, I will continue …

Continue reading Learn Scratch by Analyzing Others’ Project – Platformer Game with Editing Functionality Part 3

Learn Scratch by Analyzing Others’ Project – Platformer Game with Editing Functionality Part 2

In Part 1 of this project, I introduced how this game realized some stylish visual effects, how to encode its data and store the data in a file, and how to import the data from a file by decoding its data and filling in several lists. In this post, I would like to explain how …

Continue reading Learn Scratch by Analyzing Others’ Project – Platformer Game with Editing Functionality Part 2


Follow Our Future Articles

Get new content delivered directly to your inbox.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.