-
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.
Showing
43 changed files
with
717 additions
and
386 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 | ||
|
||
# Importer le code de la bibliothèque | ||
from p5 import * | ||
from random import randint | ||
|
||
# Configuration des variables globales | ||
taille_ecran = 400 | ||
fusee_y = 400 | ||
brule = 100 | ||
rayon_orbite = 250 | ||
orbite_y = taille_ecran = rayon_orbite | ||
|
||
|
||
# La fonction dessine_fusee vient ici | ||
def dessine_fusee(): | ||
global fusee_y, carburant, brule | ||
|
||
if carburant >= brule and fusee_y > orbite_y: | ||
fusee_y -= 1 | ||
carburant -= brule | ||
print('Carburant restant : ', carburant) | ||
|
||
no_stroke() | ||
|
||
for i in range(25): | ||
fill(255, 255 - i * 10, 0) | ||
ellipse(width/2, fusee_y + i, 8, 3) | ||
|
||
fill(200, 200, 200, 100) # gris transparent | ||
for i in range(20): # dessiner 20 ellipses de fumée aléatoire | ||
ellipse(width/2 + randint(-5, 5), fusee_y + | ||
randint(20, 50), randint(5, 10), randint(5, 10)) | ||
|
||
if carburant < brule and fusee_y > orbite_y: | ||
tint(255, 0, 0) | ||
elif carburant < 1000 and fusee_y <= orbite_y: | ||
tint(0, 255, 0) | ||
elif carburant >= 1000 and fusee_y <= orbite_y: | ||
tint(255, 200, 0) | ||
|
||
image(fusee, width/2, fusee_y, 64, 64) | ||
no_tint() | ||
|
||
|
||
# La fonction dessine_arriere_plan vient ici | ||
def dessine_arriere_plan(): | ||
background(0) | ||
image(planete, width/2, height, 300, 300) | ||
|
||
no_fill() | ||
stroke(255) | ||
stroke_weight(2) | ||
ellipse(width/2, height, rayon_orbite * 2, rayon_orbite*2) | ||
|
||
|
||
def configuration(): | ||
# Configure ton animation ici | ||
size(taille_ecran, taille_ecran) | ||
image_mode(CENTER) | ||
global planete, fusee | ||
planete = load_image('planet.png') | ||
fusee = load_image('rocket.png') | ||
|
||
|
||
def dessin(): | ||
# Choses à faire dans chaque image | ||
dessine_arriere_plan() | ||
dessine_fusee() | ||
|
||
|
||
carburant = int(input('Combien de kilos de carburant veux-tu utiliser ?')) | ||
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: 'Exemple de lancement de fusée' | ||
identifier: 'rocket-launch-example-fr-FR' | ||
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 | ||
|
||
# Importer le code de la bibliothèque | ||
from p5 import * | ||
from random import randint | ||
|
||
# Configuration des variables globales | ||
|
||
|
||
# La fonction dessine_fusee vient ici | ||
|
||
|
||
|
||
# La fonction dessine_arriere_plan vient ici | ||
|
||
|
||
|
||
def configuration(): | ||
# Configure ton animation ici | ||
|
||
|
||
|
||
def dessin(): | ||
# Choses à faire dans chaque image | ||
|
||
|
||
|
||
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: "Lancement de fusée" | ||
identifier: 'rocket-launch-starter-fr-FR' | ||
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 | ||
|
||
# Importer le code de la bibliothèque | ||
from p5 import * | ||
from random import randint | ||
|
||
# Configuration des variables globales | ||
taille_ecran = 400 | ||
fusee_y = taille_ecran # commencer en bas | ||
brule = 100 # quelle est la quantité de carburant brûlée dans chaque image | ||
rayon_orbite = 250 | ||
orbite_y = taille_ecran - rayon_orbite | ||
rayon_orbite_haut = 350 | ||
orbite_haut_y = taille_ecran - rayon_orbite_haut | ||
vitesse = 1 # Jusqu'où la fusée vole à chaque image | ||
|
||
# La fonction dessine_fusee vient ici | ||
|
||
|
||
def dessine_fusee(): | ||
global fusee_y, carburant, brule | ||
|
||
if carburant >= brule and fusee_y > orbite_haut_y: # toujours en vol | ||
fusee_y -= vitesse # Déplace la fusée | ||
carburant -= brule # brûler du carburant | ||
print('Carburant restant : ', carburant) | ||
|
||
no_stroke() # Désactive le trait | ||
|
||
for i in range(25): # dessiner 25 ellipses d'échappement en combustion | ||
fill(255, 255 - i*10, 0) # jaune | ||
# i augmente à chaque fois que la boucle se répète | ||
ellipse(width/2, fusee_y + i, 8, 3) | ||
|
||
fill(200, 200, 200, 100) # gris transparent | ||
|
||
for i in range(20): # dessiner 20 ellipses de fumée aléatoire | ||
ellipse(width/2 + randint(-5, 5), fusee_y + | ||
randint(20, 50), randint(5, 10), randint(5, 10)) | ||
|
||
if carburant < brule and fusee_y > orbite_haut_y: # Plus de carburant et pas en orbite | ||
tint(255, 0, 0) # Échec | ||
elif fusee_y <= orbite_y and fusee_y > orbite_haut_y: | ||
tint(0, 255, 0) # Succès | ||
elif carburant < 1000 and fusee_y <= orbite_haut_y: | ||
tint(0, 100, 200) # succès orbite haute | ||
elif carburant >= 1000 and fusee_y <= orbite_haut_y: | ||
tint(255, 200, 0) # Trop de carburant | ||
|
||
image(fusee, width/2, fusee_y, 64, 64) | ||
no_tint() | ||
|
||
|
||
# La fonction dessine_arriere_plan vient ici | ||
def dessine_arriere_plan(): | ||
background(0) # raccourci pour background(0, 0, 0) - noir | ||
image(planete, width/2, height, 300, 300) # dessine l'image | ||
|
||
# Dessine l'orbite basse | ||
no_fill() # Désactive tout remplissage | ||
stroke(255) # Définir un trait blanc | ||
stroke_weight(2) | ||
ellipse(width/2, height, rayon_orbite*2, rayon_orbite*2) | ||
|
||
# Dessine l'orbite haute | ||
stroke(0, 100, 200) # Définir un trait bleuâtre | ||
stroke_weight(2) | ||
ellipse(width/2, height, rayon_orbite_haut*2, rayon_orbite_haut*2) | ||
|
||
|
||
def configuration(): | ||
# Configure ton animation ici | ||
size(taille_ecran, taille_ecran) | ||
image_mode(CENTER) | ||
global planete, fusee | ||
planete = load_image('orange_planet.png') # ta planète choisie | ||
fusee = load_image('rocket.png') | ||
|
||
|
||
def dessin(): | ||
# Choses à faire dans chaque image | ||
dessine_arriere_plan() | ||
dessine_fusee() | ||
|
||
|
||
carburant = int(input('Combien de kilos de carburant veux-tu utiliser ?')) | ||
brule = int(input('Quelle quantité de carburant la fusée doit-elle brûler à chaque image ?')) | ||
vitesse = int(input('Quelle distance la fusée doit-elle parcourir à chaque image ?')) | ||
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: 'Mise à niveau du lancement de fusée' | ||
identifier: 'rocket-launch-upgrade-fr-FR' | ||
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.
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
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,85 @@ | ||
Importer le code de la bibliothèque | ||
|
||
Configurer les variables globales | ||
|
||
La fonction dessine_fusee vient ici | ||
|
||
La fonction dessine_arriere_plan vient ici | ||
|
||
Configure ton animation ici | ||
|
||
Choses à faire dans chaque image | ||
|
||
Définitions pour la compatibilité avec la bibliothèque de traitement p5py | ||
|
||
Forme | ||
|
||
Polices | ||
|
||
Texte | ||
|
||
Couleur | ||
|
||
Images | ||
|
||
Environnement | ||
|
||
Transformer | ||
|
||
Clavier | ||
|
||
Ta planète choisie | ||
|
||
Raccourci pour background(0, 0, 0) - noir | ||
|
||
Dessine l'image | ||
|
||
Commencer en bas | ||
|
||
Utiliser la variable globale fusee_y | ||
|
||
Déplace la fusée | ||
|
||
Désactive le trait | ||
|
||
Dessiner 25 ellipses d'échappement brûlant | ||
|
||
Jaune | ||
|
||
i augmente à chaque fois que la boucle se répète | ||
|
||
Réduire la quantité de vert | ||
|
||
Gris transparent | ||
|
||
Dessiner 20 ellipses de fumée aléatoire | ||
|
||
Quelle est la quantité de carburant brûlée dans chaque image | ||
|
||
Brûler du carburant | ||
|
||
Encore assez de carburant | ||
|
||
Désactive tout remplissage | ||
|
||
Définir un trait blanc | ||
|
||
Toujours en vol | ||
|
||
Plus de carburant et pas en orbite | ||
|
||
Échec | ||
|
||
Donc la planète n'est pas teintée de rouge dans l'image suivante ! | ||
|
||
Succès | ||
|
||
Trop de carburant | ||
|
||
Donc la planète n'est pas teintée dans l'image suivante ! | ||
|
||
Vert | ||
|
||
Orange | ||
|
||
Rouge |
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,33 @@ | ||
taille_ecran | ||
|
||
fusee_y | ||
|
||
brule | ||
|
||
rayon_orbite | ||
|
||
orbite_y | ||
|
||
dessine_fusee | ||
|
||
carburant | ||
|
||
Carburant restant : | ||
|
||
fusee | ||
|
||
dessine_arriere_plan | ||
|
||
planete | ||
|
||
Combien de kilos de carburant veux-tu utiliser ? | ||
|
||
Combien de carburant la fusée doit-elle brûler à chaque image ? | ||
|
||
Quelle distance la fusée doit-elle parcourir à chaque image ? | ||
|
||
Looping | ||
|
||
points | ||
|
||
vies |
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
Oops, something went wrong.