-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make main project in line with integrated editor (#64)
* 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
1 parent
40e80fe
commit 2e02d01
Showing
92 changed files
with
1,734 additions
and
753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
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.
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.
File renamed without changes
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.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --- |
Oops, something went wrong.