5 small Python games + source code, I was going to help my nephew quit mobile game addiction, but I went crazy with him

I didn't like playing games at first, but recently my brother put his grandson in my house and asked us to help him. My little nephew loves to play games. He is in his early sixties and seven years old and stares at the King of Glory every day. , it's really a headache.

Then I thought of a way to use Python to change the Xiaoxiaole game, add a layer of "skin" of the glory of the king, confiscated his mobile phone, and let him play this kind of game that can exercise his intelligence a little.

insert image description here

These games are written in Python. I collected them in the past. I think some games are not well set in the middle, and I have changed them according to personal preferences. I will share them with you today. Or you can refer to it if you want to make a small game.

There is a network disk link at the end of the article, you can pick it up yourself if you need it.


1. Glory of the King

Just like the usual matchmaking, three identical patterns can be eliminated by connecting them together. Eliminate as many identical patterns as possible within the specified time to get a higher score.

insert image description here

To be honest, I play this game with my grand-nephew, and I really can't play him. His eyes are too sharp.


2. Backgammon

I can't play Xiaoxiao Le, so I made a special one that I'm good at, backgammon. I started playing this game when I was ten years old. This little brat has never won with me, hahaha.

insert image description here


3. Tank battle

Tank Wars is a classic old game, you can play it with two people, the only downside is that it always feels weird when the shell hits the wall, but I don't want to fix it, anyway, as long as the kid doesn't face it Shooting at the boss is good.

insert image description here


4. Eat Peas

The rule of this game is that players can clear the level by eating all the yellow beans without being caught by the ghosts of the system. Although the ghosts in the system look silly, to be honest, I passed the first level. No, but that little brat can pass the level.

insert image description here

Fan Welfare


5. Google Dinosaurs

This game is a small dinosaur game that imitates when the Chrome browser is disconnected from the Internet. Use the space bar to control the advancing dinosaurs. If it encounters flying objects or plants, it will fail. The more plants and flying objects the little dinosaur avoids, the higher the score. high.

insert image description here


Game source code, you need to get it by yourself:

Link: https://pan.baidu.com/s/1it1eizZJrLWfsZeRCJJn8w

Extraction code: lg8d

My little nephew stayed at my house for a week. I would take him to play this every night when I was free. At first, he was very stubborn when he was not allowed to play mobile games. Later, after I played games made by Python with me It stuck with me. In fact, I did not simply let him switch from one game to another, but when he became familiar with the game, I would simply explain some of the internal principles of the game to him.

Of course, he can't understand the code, and I won't talk to him about the code. I just tell him how the game is designed and what some essential things are, so that he won't be fascinated by the shell of the game.

insert image description here

One day I came home and found that this guy actually opened my computer and found the source file, and secretly modified the parameters because he wanted to make the game easier...

insert image description here

Guess you like

Origin blog.csdn.net/zhiguigu/article/details/121206666