Pylash Project Address
Create a project
In this case our project will be created, and then just fill in the code in main.py to run.
Write Hello World Applet
Writing games
With a little understanding of pylash, we can begin to write the game. First we delete all the code after line fourth.
Introduce the required
Global variables
In the game to use some of the global variables, we first browse again, different know what they are doing, then will use:
Load Resources
Create Start interface
In the main function we call the Gameinit function, so add this function:
Start the game
The listener of the stage-level mouse Click event is the Startgame function, which means that we start the game by clicking on the Start screen. To modify the Startgame function:
Player character class
Drop Item Category: Item
Modifying event listeners
Bonus points and Game over
Our fruit-picking game is here to finish. So it is very convenient to develop small games with Python+pylash.
Reprint statement: Reprint-Life is too short, I used to send Sen
Using Python to develop a super simple fruit game, the 0 Foundation can also learn