Skip to content

Commit

Permalink
Merge pull request #113 from raspberrypilearning/draft
Browse files Browse the repository at this point in the history
Fix translatioin
  • Loading branch information
sashamishcheriakova authored Mar 22, 2024
2 parents 7702989 + 710804c commit 9c1852a
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 67 deletions.
8 changes: 4 additions & 4 deletions fr-FR/code/dont_collide_avoid_germs_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def joueur_sur():

# Les yeux
fill(178, 200, 145)
ellipse(mouse_x - 10, joueurs_y - 10, 20, 20)
ellipse(mouse_x - 10, joueur_y - 10, 20, 20)
ellipse(mouse_x + 10, joueur_y - 10, 20, 20)
fill(0)
ellipse(mouse_x - 10, joueur_y - 10, 10, 10)
Expand Down Expand Up @@ -68,13 +68,13 @@ def dessine_joueur():
if mouse_x < width: # dépasse la gauche de l'écran
collision2 = sur.hex

if mouse_x > width : # dépasse la droite de l'écran
if mouse_x > width: # dépasse la droite de l'écran
collision3 = sur.hex

#print(collision, collision2, collision3, collision4)

if collision == sur.hex and collision2 == sur.hex and collision3 == sur.hex and collision4 == sur.hex:
joueur_sur() 
joueur_sur()
score += niveau
else: # Collision
joueur_ecrase()
Expand Down Expand Up @@ -113,7 +113,7 @@ def draw():
fill(145, 134, 126)
text('Score: ' + str(score), width/2, 20)
dessine_obstacles()
dessine_joueur() 
dessine_joueur()

# Garde ceci pour exécuter ton code
run()
4 changes: 2 additions & 2 deletions fr-FR/code/dont_collide_clean_car_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def dessine_joueur():
joueur_x = int(width * 0.2)
joueur_y = mouse_y

collision = get(joueur_x + 50, joueur_y + 15)
collision = get(joueur_x + 50, joueur_y + 15).hex
collision2 = get(joueur_x + 50, joueur_y - 15).hex
collision3 = get(joueur_x, joueur_y + 15).hex
collision4 = get(joueur_x, joueur_y - 15).hex
Expand Down Expand Up @@ -78,6 +78,6 @@ def draw():
text_size(20)
text_align(CENTER, TOP) # position près du centre, en haut
dessine_obstacles()
dessine_joueur() 
dessine_joueur()

run()
2 changes: 1 addition & 1 deletion fr-FR/code/dont_collide_dodge_asteroids_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def draw():
fill(255)
image_mode(CENTER)
dessine_obstacles()
dessine_joueur() 
dessine_joueur()
affichage_score()
affichage_vies()

Expand Down
6 changes: 3 additions & 3 deletions fr-FR/code/dont_collide_dont_pop_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def dessine_joueur():
collision3 = get(mouse_x + 12, joueur_y + 20).hex
collision4 = get(mouse_x, joueur_y + 40).hex

if mouse_x < width : # hors de la gauche de l'écran
if mouse_x < width: # hors de la gauche de l'écran
collision2 = sur.hex

if mouse_x > width : # hors de la droite de l'écran
if mouse_x > width: # hors de la droite de l'écran
collision3 = sur.hex

if collision == sur.hex and collision2 == sur.hex and collision3 == sur.hex and collision4 == sur.hex:
Expand All @@ -64,7 +64,7 @@ def draw():
if niveau > 0:
background(sur)
fill(255)
text('Score: ' + str(score), width/2, 20)
text('Score : ' + str(score), width/2, 20)
dessine_obstacles()
dessine_joueur()

Expand Down
54 changes: 27 additions & 27 deletions nl-NL/code/dont_collide_avoid_germs_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,64 @@ def speler_veilig():

# Gezicht
fill(200, 134, 145)
ellipse(muis_x, speler_y, 60, 60)
ellipse(mouse_x, speler_y, 60, 60)

# Ogen
fill(178, 200, 145)
ellipse(muis_x - 10, speler_y - 10, 20, 20)
ellipse(muis_x + 10, speler_y - 10, 20, 20)
ellipse(mouse_x - 10, speler_y - 10, 20, 20)
ellipse(mouse_x + 10, speler_y - 10, 20, 20)
fill(0)
ellipse(muis_x - 10, speler_y - 10, 10, 10)
ellipse(muis_x + 10, speler_y - 10, 10, 10)
ellipse(mouse_x - 10, speler_y - 10, 10, 10)
ellipse(mouse_x + 10, speler_y - 10, 10, 10)
fill(255)
ellipse(muis_x - 12, speler_y - 12, 5, 5)
ellipse(muis_x + 12, speler_y - 12, 5, 5)
ellipse(mouse_x - 12, speler_y - 12, 5, 5)
ellipse(mouse_x + 12, speler_y - 12, 5, 5)

# Mond
fill(0)
ellipse(muis_x, speler_y + 10, 15, 10)
ellipse(mouse_x, speler_y + 10, 15, 10)
fill(200, 134, 145)
ellipse(muis_x, speler_y + 5, 10, 10)
ellipse(mouse_x, speler_y + 5, 10, 10)

def speler_gebotst():
global speler_y

# Gezicht
fill(178, 200, 145)
ellipse(muis_x, speler_y, 60, 60)
ellipse(mouse_x, speler_y, 60, 60)

# Ogen
fill(149, 161, 195)
ellipse(muis_x - 10, speler_y - 10, 20, 20)
ellipse(muis_x + 10, speler_y - 10, 20, 20)
ellipse(mouse_x - 10, speler_y - 10, 20, 20)
ellipse(mouse_x + 10, speler_y - 10, 20, 20)
fill(0)
ellipse(muis_x - 10, speler_y - 10, 10, 10)
ellipse(muis_x + 10, speler_y - 10, 10, 10)
ellipse(mouse_x - 10, speler_y - 10, 10, 10)
ellipse(mouse_x + 10, speler_y - 10, 10, 10)
fill(255)
ellipse(muis_x - 12, speler_y - 12, 5, 5)
ellipse(muis_x + 12, speler_y - 12, 5, 5)
ellipse(mouse_x - 12, speler_y - 12, 5, 5)
ellipse(mouse_x + 12, speler_y - 12, 5, 5)

# Mond
fill(0)
ellipse(muis_x, speler_y + 15, 15, 10)
ellipse(mouse_x, speler_y + 15, 15, 10)
fill(178, 200, 145)
ellipse(muis_x, speler_y + 20, 10, 10)
ellipse(mouse_x, speler_y + 20, 10, 10)

def teken_speler():

global speler_y, veilig, score, level

speler_y = int(height * 0,8)
speler_y = int(height * 0.8)

botsen = get(muis_x, speler_y)
botsen2 = get(muis_x, speler_y + 30).hex
botsen3 = get(muis_x + 30, speler_y).hex
botsen4 = get(muis_x, speler_y - 30).hex
botsen = get(mouse_x, speler_y).hex
botsen2 = get(mouse_x, speler_y + 30).hex
botsen3 = get(mouse_x + 30, speler_y).hex
botsen4 = get(mouse_x, speler_y - 30).hex

if muis_x < width: # voorbij de linkerkant van het scherm
if mouse_x < width: # voorbij de linkerkant van het scherm
botsen2 = veilig.hex

if muis_x > width: # voorbij de rechterkant van het scherm
if mouse_x > width: # voorbij de rechterkant van het scherm
botsen3 = veilig.hex

#print(botsen, botsen2, botsen3, botsen4)
Expand All @@ -93,7 +93,7 @@ def teken_obstakels():
ob_x = randint(0, width)
ob_y = randint(0, height) + frame_count
ob_y %= height
tekst('🦠', ob_x, ob_y)
text('🦠', ob_x, ob_y)

def setup():
# Zet de code om eenmalig uit te voeren hier onder
Expand All @@ -106,7 +106,7 @@ def draw():
# Zet hier code om bij elk frame uit te voeren
global score, veilig, level

veilig = color(149, 161, 195)
veilig = Color(149, 161, 195)

if level > 0:
background(veilig)
Expand Down
6 changes: 3 additions & 3 deletions nl-NL/code/dont_collide_clean_car_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def teken_speler():
global score, level

speler_x = int(width * 0.2)
speler_y = muis_y
speler_y = mouse_y

botsen = get(speler_x + 50, speler_y + 15).hex
botsen2 = get(speler_x + 50, speler_y - 15).hex
botsen3 = get(speler_x, speler_y + 15),hex
botsen3 = get(speler_x, speler_y + 15).hex
botsen4 = get(speler_x, speler_y - 15).hex
botsen5 = get(speler_x - 50, speler_y + 15).hex
botsen6 = get(speler_x - 50, speler_y - 15).hex
Expand All @@ -42,7 +42,7 @@ def teken_speler():
botsen3 = veilig.hex
botsen5 = veilig.hex

elif player_y < 18: # Buiten de bovenkant van het scherm
elif speler_y < 18: # Buiten de bovenkant van het scherm
botsen2 = veilig.hex
botsen4 = veilig.hex
botsen6 = veilig.hex
Expand Down
26 changes: 13 additions & 13 deletions nl-NL/code/dont_collide_dodge_asteroids_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def teken_obstakels():
print('Je hebt level', level, 'bereikt')

for i in range(6 + level):
ob_x = randint(0, width)
obstakel_x = randint(0, width)
obstakel_y = randint(0, height) + (frame_count * level)
obstakel_y %= height # omwikkelen
push_matrix()
translate(ob_x, ob_y)
translate(obstakel_x, obstakel_y)
rotate(degrees(randint(1, 359)+frame_count / 1000))
image(rots, 0, 0, randint(18,24), randint(18,24))
pop_matrix()
Expand All @@ -34,25 +34,25 @@ def teken_obstakels():
def teken_speler():
global score, level, levens, onkwetsbaar

speler_y = int(height * 0,8)
speler_x = muis_x
speler_y = int(height * 0.8)
speler_x = mouse_x

botsen = get(speler_x, speler_y).hex
botsen2 = get(speler_x + 18, speler_y - 17).hex
botsen3 = get(speler_x + 18, speler_y + 17).hex
botsen4 = get(speler_x, speler_y + 25).hex

if player_x < width: # aan de linkerkant van het scherm
if speler_x < width: # aan de linkerkant van het scherm
botsen2 = veilig.hex

als speler_x > width: # aan de rechterkant van het scherm
if speler_x > width: # aan de rechterkant van het scherm
botsen3 = veilig.hex

if (botsen == veilig.hex and botsen2 == veilig.hex and botsen3 == veilig.hex and botsen4 == veilig.hex) or onkwetsbaar >0:
if levens == 0 and frame_count % 12 == 0:
tint(200, 0, 0)

image(rocket, speler_x, speler_y + 25, 64, 64)
image(raket, speler_x, speler_y + 25, 64, 64)
score += level
onkwetsbaar -= 1
no_tint()
Expand All @@ -66,7 +66,7 @@ def teken_speler():
levens -= 1
onkwetsbaar = 50
tint(200, 0, 0)
image(rocket, speler_x, speler_y + 25, 64, 64)
image(raket, speler_x, speler_y + 25, 64, 64)
no_tint()
score += level
else:
Expand Down Expand Up @@ -95,7 +95,7 @@ def toon_levens():
text('Levens', width * 0.05, 10, 30, 20)

for i in range(levens):
image(rocket, width * 0.05 + i * 25, 40, 20, 20)
image(raket, width * 0.05 + i * 25, 40, 20, 20)


def setup():
Expand All @@ -106,8 +106,8 @@ def setup():
text_size(40)
text_align(CENTER, TOP) # positie rond het midden, bovenaan

rocket = load_image('rocket.png')
rock = load_image('moon.png')
raket = load_image('rocket.png')
rots = load_image('moon.png')
random_seed = randint(0, 1000000)

def draw():
Expand All @@ -121,7 +121,7 @@ def draw():
image_mode(CENTER)
teken_obstakels()
teken_speler()
display_score()
display_levens()
toon_score()
toon_levens()

run()
18 changes: 9 additions & 9 deletions nl-NL/code/dont_collide_dont_pop_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ def teken_obstakels():
def teken_speler():
global score, level

speler_y = int(height * 0,8)
speler_y = int(height * 0.8)

botsen = get(muis_x, speler_y).hex
botsen2 = get(muis_x, speler_y + 20).hex
botsen3 = get(muis_x + 12, speler_y + 20).hex
botsen4 = get(muis_x, speler_y + 40).hex
botsen = get(mouse_x, speler_y).hex
botsen2 = get(mouse_x, speler_y + 20).hex
botsen3 = get(mouse_x + 12, speler_y + 20).hex
botsen4 = get(mouse_x, speler_y + 40).hex

if muis_x < width: # aan de linkerkant van het scherm
if mouse_x < width: # aan de linkerkant van het scherm
botsen2 = veilig.hex

if muis_x > width: # voorbij de rechterkant van het scherm
if mouse_x > width: # voorbij de rechterkant van het scherm
botsen3 = veilig.hex

if botsen == veilig.hex and botsen2 == veilig.hex and botsen3 == veilig.hex and botsen4 == veilig.hex:
text('🎈', muis_x, speler_y)
text('🎈', mouse_x, speler_y)
score += level
else:
text('💥', muis_x, speler_y)
text('💥', mouse_x, speler_y)
level = 0


Expand Down
8 changes: 4 additions & 4 deletions nl-NL/code/dont_collide_skiing_cat_example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ def teken_obstakels():
def teken_speler():
global score, snelheid, skien, gecrasht

speler_y = int(height * 0,8)
speler_y = int(height * 0.8)

fill(veilig)

botsen = get(muis_x, speler_y).hex
botsen = get(mouse_x, speler_y).hex

if botsen == veilig.hex:
image(skien, muis_x, speler_y, 30, 30)
image(skien, mouse_x, speler_y, 30, 30)
score += snelheid
else:
afbeelding(gecrasht, muis_x, speler_y, 30, 30)
image(gecrasht, mouse_x, speler_y, 30, 30)
snelheid = 0


Expand Down
2 changes: 1 addition & 1 deletion nl-NL/step_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def teken_obstakles():

if frame_count % height == height - 1 and level < 5:
level += 1
print('Je hebt niveau', level, 'bereikt')
print('Je hebt level', level, 'bereikt')

--- /code ---

Expand Down

0 comments on commit 9c1852a

Please sign in to comment.