Skip to content

Commit d3184e1

Browse files
Merge pull request #76 from raspberrypilearning/draft
Update translation
2 parents 284f7ea + 814268b commit d3184e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+475
-777
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Імпортуй код бібліотеки
2+
from p5 import *
3+
from random import randint
4+
5+
# Встанови глобальні змінні
6+
screen_size = 400
7+
rocket_position = screen_size
8+
9+
10+
# Тут буде функція draw_rocket
11+
def draw_rocket():
12+
global rocket_position
13+
rocket_position = rocket_position - 1
14+
image(rocket, width / 2, rocket_position, 64, 64)
15+
fill(200, 200, 200, 100)
16+
no_stroke()
17+
for i in range(20):
18+
circle_size = randint(5, 10)
19+
ellipse(
20+
screen_size / 2 + randint(-5, 5),
21+
rocket_position + randint(20, 50),
22+
circle_size,
23+
circle_size,
24+
)
25+
26+
27+
# Тут буде функція draw_background
28+
def draw_background():
29+
background(0, 0, 0)
30+
image(planet, screen_size / 2, screen_size, 300, 300)
31+
32+
33+
def setup():
34+
# Тут налаштуй анімацію
35+
size(screen_size, screen_size)
36+
image_mode(CENTER)
37+
global planet, rocket
38+
planet = load_image("purple_planet.png")
39+
rocket = load_image("rocket.png")
40+
41+
42+
def draw():
43+
# Що відбувається на кожному кадрі
44+
draw_background()
45+
draw_rocket()
46+
47+
48+
run()
47 KB
Loading
49.3 KB
Loading
51.6 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: 'Ракета летить у космос — приклад'
2+
identifier: 'rocket-launch-example'
3+
type: 'python'
52.2 KB
Loading
34.4 KB
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Імпортуй код бібліотеки
2+
from p5 import *
3+
from random import randint
4+
5+
# Встанови глобальні змінні
6+
screen_size = 400
7+
8+
# Тут буде функція draw_rocket
9+
10+
11+
12+
# Тут буде функція draw_background
13+
14+
15+
16+
def setup():
17+
# Тут налаштуй анімацію
18+
size(screen_size, screen_size)
19+
image_mode(CENTER)
20+
global planet
21+
planet = load_image('planet.png')
22+
23+
24+
def draw():
25+
# Що відбувається на кожному кадрі
26+
27+
28+
29+
30+
run()
31+
32+
33+
47 KB
Loading
49.3 KB
Loading

0 commit comments

Comments
 (0)