Skip to content

Commit

Permalink
Make main project in line with integrated editor (#64)
Browse files Browse the repository at this point in the history
* Vastly simplify 2

* Remove the totally pointless shebang

* Update starter code

* Update step 3

* Lots of updates and remove a couple of steps

* Loads of upgrades

* Typos

* Rebuild starter

* Add translation

German

---------

Co-authored-by: sashamishcheriakova <135987917+sashamishcheriakova@users.noreply.github.com>
  • Loading branch information
lawsie and sashamishcheriakova authored Nov 8, 2024
1 parent 40e80fe commit 2e02d01
Show file tree
Hide file tree
Showing 92 changed files with 1,734 additions and 753 deletions.
73 changes: 73 additions & 0 deletions de-DE/code/rocket-launch-solution/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/python3

# Bibliothekscode importieren
from p5 import *
from random import randint

# Globale Variablen einrichten
bildschirm_groesse = 400
rakete_y = 400
verbrennen = 100
orbit_radius = 250
orbit_y = bildschirm_groesse - orbit_radius


# Die Funktion „zeichne_rakete“ kommt hierher
def zeichne_rakete():
global rakete_y, treibstoff, verbrennen

if treibstoff >= verbrennen and rakete_y > orbit_y:
rakete_y -= 1
treibstoff -= verbrennen
print('Verbleibender Treibstoff: ', treibstoff)

no_stroke()

for i in range(25):
fill(255, 255 - i * 10, 0)
ellipse(width/2, rakete_y + i, 8, 3)

fill(200, 200, 200, 100) # Transparent grau
for i in range(20): # Zeichne 20 zufällige Rauchellipsen
ellipse(width/2 + randint(-5, 5), rakete_y +
randint(20, 50), randint(5, 10), randint(5, 10))

if treibstoff < verbrennen and rakete_y > orbit_y:
tint(255, 0, 0)
elif treibstoff < 1000 and rakete_y <= orbit_y:
tint(0, 255, 0)
elif treibstoff >= 1000 and rakete_y <= orbit_y:
tint(255, 200, 0)

image(rakete, width/2, rakete_y, 64, 64)
no_tint()


# Die Funktion „zeichne_hintergrund“ kommt hierher
def zeichne_hintergrund():
background(0)
image(planet, width/2, height, 300, 300)

no_fill()
stroke(255)
stroke_weight(2)
ellipse(width/2, height, orbit_radius * 2, orbit_radius * 2)


def setup():
# Richte hier Deine Animation ein
size(bildschirm_groesse, bildschirm_groesse)
image_mode(CENTER)
global planet, rakete
planet = load_image('planet.png')
rakete = load_image('rocket.png')


def draw():
# Dinge die in jedem Frame passieren
zeichne_hintergrund()
zeichne_rakete()


treibstoff = int(input('Wie viele Kilogramm Treibstoff willst Du verbrauchen?'))
run()
Binary file added de-DE/code/rocket-launch-solution/moon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/code/rocket-launch-solution/planet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions de-DE/code/rocket-launch-solution/project_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 'Beispiel Raketenstart'
identifier: 'rocket-launch-example'
type: 'python'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/code/rocket-launch-solution/rocket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions de-DE/code/rocket-launch-starter/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/python3

# Bibliothekscode importieren
from p5 import *
from random import randint

# Globale Variablen einrichten


# Die Funktion „zeichne_rakete“ kommt hierher



# Die Funktion „zeichne_hintergrund“ kommt hierher



def setup():
# Richte hier Deine Animation ein



def draw():
# Dinge die in jedem Frame passieren



run()
Binary file added de-DE/code/rocket-launch-starter/moon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/code/rocket-launch-starter/planet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions de-DE/code/rocket-launch-starter/project_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: "Raketenstart"
identifier: 'rocket-launch-starter'
type: 'python'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/code/rocket-launch-starter/rocket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions de-DE/code/rocket-launch-upgrade/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/python3

# Bibliothekscode importieren
from p5 import *
from random import randint

# Globale Variablen einrichten
bildschirm_groesse = 400
rakete_y = bildschirm_groesse # unten starten
verbrennen = 100 # Wieviel Treibstoff wird in jedem Frame verbrannt
orbit_radius = 250
orbit_y = bildschirm_groesse - orbit_radius
hoher_orbit_radius = 350
hoher_orbit_y = bildschirm_groesse - hoher_orbit_radius
geschwindigkeit = 1 # Wie weit die Rakete in jedem Frame fliegt

# Die Funktion „zeichne_rakete“ kommt hierher


def zeichne_rakete():
global rakete_y, treibstoff, verbrennen

if treibstoff >= verbrennen and rakete_y > hoher_orbit_y: # fliegt immer noch
rakete_y -= geschwindigkeit # Bewege die Rakete
treibstoff -= verbrennen # Treibstoff verbrennen
print('Verbleibender Treibstoff: ', treibstoff)

no_stroke() # Schaltet Zeichnen aus

for i in range(25): # Zeichne 25 brennende Abgasellipsen
fill(255, 255 - i*10, 0) # gelb
# i erhöht sich bei jeder Wiederholung der Schleife
ellipse(width/2, rakete_y + i, 8, 3)

fill(200, 200, 200, 100) # Transparent grau

for i in range(20): # Zeichne 20 zufällige Rauchellipsen
ellipse(width/2 + randint(-5, 5), rakete_y +
randint(20, 50), randint(5, 10), randint(5, 10))

if treibstoff < verbrennen and rakete_y > hoher_orbit_y: # kein Treibstoff mehr und nicht im Orbit
tint(255, 0, 0) # Versagen
elif rakete_y <= orbit_y and rakete_y > hoher_orbit_y:
tint(0, 255, 0) # Erfolg
elif treibstoff < 1000 and rakete_y <= hoher_orbit_y:
tint(0, 100, 200) # Erfolg: hoher Orbit
elif treibstoff >= 1000 and rakete_y <= hoher_orbit_y:
tint(255, 200, 0) # Zu viel Treibstoff

image(rakete, width/2, rakete_y, 64, 64)
no_tint()


# Die Funktion „zeichne_hintergrund“ kommt hierher
def zeichne_hintergrund():
background(0) # Kurzform für background(0, 0, 0) - schwarz
image(planet, width/2, height, 300, 300) # zeichne das Bild

# Zeichne die untere Umlaufbahn
no_fill() # Jegliche Füllung ausschalten
stroke(255) # Setzt einen weißen Strich
stroke_weight(2)
ellipse(width/2, height, orbit_radius * 2, orbit_radius * 2)

# Zeichne die höhere Umlaufbahn
stroke(0, 100, 200) # Setzt einen bläulichen Strich
stroke_weight(2)
ellipse(width/2, height, hoher_orbit_radius * 2, hoher_orbit_radius * 2)


def setup():
# Richte hier Deine Animation ein
size(bildschirm_groesse, bildschirm_groesse)
image_mode(CENTER)
global planet, rakete
planet = load_image('orange_planet.png') # Dein gewählter Planet
rakete = load_image('rocket.png')


def draw():
# Dinge die in jedem Frame passieren
zeichne_hintergrund()
zeichne_rakete()


treibstoff = int(input('Wie viele Kilogramm Treibstoff willst Du verbrauchen?'))
verbrennen = int(input('Wie viel Treibstoff soll die Rakete pro Frame verbrennen?'))
geschwindigkeit = int(input('Wie weit soll die Rakete pro Frame fliegen?'))
run()
Binary file added de-DE/code/rocket-launch-upgrade/moon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/code/rocket-launch-upgrade/planet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions de-DE/code/rocket-launch-upgrade/project_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 'Upgrade Raketenstart'
identifier: 'rocket-launch-upgrade'
type: 'python'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/code/rocket-launch-upgrade/rocket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/burn_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/burn_question.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/burn_question_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/check_orbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/countdown_backwards.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/countdown_fixed.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added de-DE/images/draw_orbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/fly.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added de-DE/images/flying_rocket.gif
Binary file added de-DE/images/fuel_orbit_fail.gif
Binary file added de-DE/images/fuel_orbit_success.gif
Binary file added de-DE/images/image_gallery.png
Binary file added de-DE/images/katherine_johnson.jpeg
Binary file added de-DE/images/make-a-face-project.png
Binary file added de-DE/images/orbit.png
Binary file added de-DE/images/orbit_failure.png
Binary file added de-DE/images/orbit_meh.png
Binary file added de-DE/images/orbit_success.png
Binary file added de-DE/images/planet100300.png
Binary file added de-DE/images/planet128128.png
Binary file added de-DE/images/planet300100.png
Binary file added de-DE/images/planet400200.png
Binary file added de-DE/images/planet_grid.png
Binary file added de-DE/images/quiz_planet.png
Binary file added de-DE/images/rocket_amber.png
Binary file added de-DE/images/rocket_exhaust.png
Binary file added de-DE/images/rocket_exhaust_circles.gif
Binary file added de-DE/images/rocket_fly.gif
Binary file added de-DE/images/rocket_green.png
Binary file added de-DE/images/rocket_image.png
Binary file added de-DE/images/rocket_original.png
Binary file added de-DE/images/rocket_red.png
Binary file added de-DE/images/rocket_smoke.gif
Binary file added de-DE/images/showcase.png
Binary file added de-DE/images/step_2.png
Binary file added de-DE/images/tint_orbit.gif
File renamed without changes
File renamed without changes
31 changes: 31 additions & 0 deletions de-DE/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Raketenstart
hero_image: images/banner.png
description: Erstelle eine Animation einer Rakete, die einen Satelliten in die Umlaufbahn bringt
meta_title: Python Programmierprojekte für Kinder und Jugendliche | Raketenstart
meta_description: Lerne Python mit den Programmierprojekten für Kinder und Jugendliche der Raspberry Pi Foundation. Erstelle eine Python-Animation, die zeigt, wie eine Rakete einen Satelliten in die Umlaufbahn bringt.
version: 0.0.1
listed: true
copyedit: true
last_tested: "2021-10-06"
steps:
- title: Das wirst du machen
- title: Einrichten der Szene
- title: Abheben!
completion:
- engaged
- title: Abgaseffekte
- title: Treibstoff verbrennen
- title: Erreichen der Umlaufbahn
completion:
- internal
- title: Kurzes Quiz
knowledge_quiz:
path: quiz1
version: 1
questions: 3
passing_score: 3
completion:
- external
- title: Mach dein Projekt noch cooler
- title: Wie geht es weiter?
72 changes: 72 additions & 0 deletions de-DE/python-comments.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Globale Variablen einrichten

Richte hier Deine Animation hier ein

Positioniert das Bild in der Mitte

Dein gewählter Planet

Die Funktion „zeichne_hintergrund“ kommt hierher

Kurzform für background(0, 0, 0) – schwarz

Zeichne das Bild

Dinge die in jedem Frame passieren

Die Funktion „zeichne_rakete“ kommt hierher

Unten starten

Verwende die globale Variable rakete_y

Bewege die Rakete

Zeichnen ausschalten

Zeichne 25 brennende Abgasellipsen

Gelb

i erhöht sich bei jeder Wiederholung der Schleife

Reduziere die Menge an Grün

Transparentes Grau

Zeichne 20 zufällige Rauchellipsen

Wie viel Kraftstoff wird in jedem Frame verbrannt

Wie viele Kilogramm Treibstoff willst Du verbrauchen?

Treibstoff verbrennen

Verbleibender Treibstoff:

Noch Treibstoff verfügbar

Zeichnen ausschalten

Weißen Strich einstellen

Fliegt immer noch

Kein Treibstoff mehr und nicht im Orbit

Versagen

Damit der Planet im nächsten Frame nicht rot gefärbt ist!

Erfolg

Zu viel Treibstoff

Schleife

Grün

Gelb

Rot

24 changes: 24 additions & 0 deletions de-DE/python-translatable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
bildschirm_groesse

planet

zeichne_hintergrund

rakete

rakete_y

zeichne_rakete

verbrennen

treibstoff

orbit_radius

orbit_y

punkte

leben

57 changes: 57 additions & 0 deletions de-DE/quiz1/question_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Kurzes Quiz

Beantworte die drei Fragen. Hinweise helfen dir beim Finden der richtigen Antwort.

Nach dem Beantworten jeder Frage wähle **Meine Antwort prüfen**.

Viel Spaß!

--- question ---
---
legend: Frage 1 von 3
---

Welche Ausgabe würdest du erwarten, wenn du das folgende Programm ausführen würdest?

```python
for i in range(5):
print("Schleife", i)
```

--- choices ---

- ( ) Schleife 1 <br> Schleife 2 <br> Schleife 3 <br> Schleife 4 <br> Schleife 5

--- feedback ---

Nicht ganz, eine `for`-Schleife in Python wiederholt ihren Code einmal für jedes Element in einer gegebenen Sequenz, und hier erstellt `range` eine Sequenz, die bei `0`beginnt.

--- /feedback ---

- ( ) Schleife i

--- feedback ---

Nicht ganz, die **Schleifenvariable** aus einer `for`-Schleife – in diesem Fall `i` – enthält den aktuellen Wert aus der Sequenz, die die Schleife durchläuft.

--- /feedback ---

- (x) Schleife 0 <br> Schleife 1 <br> Schleife 2 <br> Schleife 3 <br> Schleife 4

--- feedback ---

Korrekt. Die Schleife wird der Reihe nach einmal für jedes Element `i` in der Sequenz [0, 1, 2, 3, 4] ausgeführt.

--- /feedback ---

- ( ) Schleife 4 <br> Schleife 3 <br> Schleife 2 <br> Schleife 1 <br> Schleife 0

--- feedback ---

Nicht ganz, eine `for`-Schleife durchläuft die ihr angegebene Elementfolge der Reihe nach. Da `range()` eine geordnete Folge von 0 bis zur übergebenen Zahl ergibt, ist dies die Reihenfolge, die du bei der Ausgabe dieser `for`-Schleife erwarten würdest.

--- /feedback ---

--- /choices ---

--- /question ---
Loading

0 comments on commit 2e02d01

Please sign in to comment.