Alterna · учебный материал

Python Game Studio

44.3: Python Games creative studio. Pyton describes the world, while Canvas browser shell triggers control and mechanics.

Что в этом материале

Содержание и основные понятия

This is the Canvas shell of the Common API, not the pygame: Python is running on Worker and returns the limited list of commands.
canvas
Browser host only draws this list on this Canvas.
creative studio
Python + Canvas
command API
01
Work Area
The studio immediately opens the full mini game: the source Python is visible on the left and completely edited. Press Run, click Canvas, and control the shooters or WASD. Space returns the player to start.
The studio's uploading...
02
Checking your own scene
Borders
First, ask the size.
canvas.size
then have the figures inside these coordinates.
Counterast
The background, obstacles and points of interest should be different in colour and size, so that the scene can be read without guessing.
Meaning
Subscriptions and lines help explain the route or the rule of the world, not turn Canvas into a random set of figures.
03
A separate project route
Minimum version
One controlled object, one target, an understandable restart, and a visible account. First, get a working cycle without jewelry.
Mechanical
Add an obstacle, a time limit, an opponent, or an object with an effect, each rule must be kept in good condition.
Testing
Check the edge of the stage, re-start, fast key pressing, win, lose, and situation without access.
Project minimum
Save the working version, then modify at least three parts of the source: data in
init
the rule in
update
and image in
draw
The game without a modified code is not considered a stand-alone project.

Structural map of textbooks