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

Block Studio

Scratch-like studio: visual blocks, Python edited generation and mini-game launch.

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

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

The visual and text forms are next to each other. Blocks help design the algorithm, but the final Python is not hidden: when you generate any strings, run the code, and check the result.
project
Python blocks
Code game
01
How to Work
1.
Add the palette blocks and the attitude of the number or color.
2.
Change order with the buttons and the button; the event should precede its script.
3.
Press Python Collection and study function
init
,
update
,
draw
.
4.
Rewrite the code to the right: add rule, object or signature.
5.
Press Run, click Canvas and control the arrows/WASD; Space restarts the game.
Important
The reassembly of the blocks will replace the manual changes to Python. First finish the visual circuit, then move to free editing.
02
Visual programme
Block Studio downloads...
03
Edited Python and Game
The code below is completely redacted. It is executed locally in a one-time Worker and can only return limited Canvas commands.
Python Studio uploads...
04
Missions
Gather the basic game, change the speed and add a second wall, make sure the player doesn't go through both walls.
After the code is generated, add a variable
lives
and show it through
canvas.text
.
Change the condition of the collection: the big crystal must give 3 points, the usual one.
Add the loss: after a certain number of moves, show the message and block the movement.
05
Project criteria
Criterion
Minimum
Strong work
Algoritm
event, traffic, condition
Several states and clear recovery
Code
Changed 3 rows Python
Added own function
Game
There's a target and feedback.
There is victory, loss and balance
Verification
Cuts and restarts
Test description and corrected error

Structural map of textbooks