Console
Clique sur « Exécuter » pour lancer le programme.
Code CoddyRun
@ ASTRO FILON
// Un jeu idle de mine spatiale pour CoddyRun.
// Clique sur l'asteroide pour extraire des cristaux, achete des machines
// qui minent toutes seules, debloque des ameliorations, attrape les cometes
// dorees... et fais un saut hyperspatial pour gagner des etoiles qui
// augmentent toute ta production. La partie est sauvegardee, et tes machines
// continuent de miner pendant ton absence.
//
// SOURIS : tout se joue a la souris
// CLAVIER : M machines A ameliorations X quitter (et sauvegarder)
@ CONFIGURATION
ecran est une toile
dimension(ecran, 560, 550)
AST_X est un nombre
AST_X vaut 145
AST_Y est un nombre
AST_Y vaut 262
AST_R est un nombre
AST_R vaut 74
PANNEAU_X est un nombre
PANNEAU_X vaut 290
// CoddyRun refuse les nombres au-dela de 2^53 : tout reste sous ce plafond
PLAFOND est un nombre
PLAFOND vaut 1000000000000000
SEUIL_SAUT est un nombre
SEUIL_SAUT vaut 300000
SUFFIXES est un tableau
SUFFIXES vaut ["k", "M", "Md", "Bn", "Bd", "Tn", "Td", "Qn", "Qd"]
@ LES MACHINES
NOMS_M est un tableau
NOMS_M vaut ["Pioche laser", "Robot foreur", "Drone collecteur", "Cargo minier", "Station orbitale", "Raffinerie lunaire", "Forge stellaire", "Portail quantique"]
PRIX_M est un tableau
PRIX_M vaut [15, 100, 1100, 12000, 130000, 1400000, 20000000, 330000000]
PROD_M est un tableau
PROD_M vaut [0.1, 1, 8, 47, 260, 1400, 7800, 44000]
COUL_M est un tableau
COUL_M vaut [#F87171, #FBBF24, #34D399, #60A5FA, #A78BFA, #F472B6, #FB923C, #C084FC]
possedes, nivMachine est un tableau
pour ki de 0 à 7
possedes ajoute 0
nivMachine ajoute 0
fin pour
@ LES AMELIORATIONS
// 5 paliers par machine (production x2), puis 6 ameliorations du clic
SEUILS_A est un tableau
SEUILS_A vaut [1, 5, 25, 50, 100]
FACT_A est un tableau
FACT_A vaut [10, 50, 500, 5000, 50000]
NOMS_PALIER est un tableau
NOMS_PALIER vaut ["Graisse cosmique", "Alliage stellaire", "Turbo à plasma", "Cœur de neutron", "Matière noire"]
CLIC_NOMS est un tableau
CLIC_NOMS vaut ["Gants magnétiques", "Marteau gravitationnel", "Doigts de titane", "Impact sismique", "Poing de comète", "Main de géant"]
CLIC_PRIX est un tableau
CLIC_PRIX vaut [100, 2000, 60000, 3000000, 200000000, 20000000000]
upType, upSeuil, upCout, upNom, upAchete est un tableau
pour ki de 0 à 7
pour kt de 0 à 4
upType ajoute ki
upSeuil ajoute SEUILS_A[kt]
upCout ajoute PRIX_M[ki] * FACT_A[kt]
upNom ajoute NOMS_PALIER[kt]
upAchete ajoute faux
fin pour
fin pour
pour kt de 0 à 5
upType ajoute -1
upSeuil ajoute 0
upCout ajoute CLIC_PRIX[kt]
upNom ajoute CLIC_NOMS[kt]
upAchete ajoute faux
fin pour
NB_AMEL est un nombre
NB_AMEL vaut 46
PREMIER_CLIC est un nombre
PREMIER_CLIC vaut 40
nivClic est un nombre
// les ameliorations proposees (les 8 moins cheres)
dispoK, dejaPris est un tableau
pour ki de 0 à 7
dispoK ajoute 0
fin pour
pour ki de 0 à NB_AMEL - 1
dejaPris ajoute faux
fin pour
nbDispo est un nombre
@ LA PARTIE
cristaux, totalPartie, totalTout, etoiles est un nombre
frenesie est un nombre
quantite est un nombre
quantite vaut 1
onglet est un nombre
// etat : 1 jeu, 4 confirmer le saut, 5 retour d'absence, 6 accueil, 7 saut en cours
etat est un nombre
etat vaut 6
appActif est un booléen
appActif vaut vrai
tic est un nombre
derniereMesure est un nombre
sauveAttente est un nombre
sauveAttente vaut 15
introVue est un booléen
introVue vaut faux
horodatage est un nombre
gainAbsence, dureeAbsence est un nombre
sautAnim, etoilesSaut est un nombre
choc est un nombre
// la comete doree
cometeAttente est un nombre
cometeAttente vaut 45
cometeVie, cometeY0 est un nombre
cometeSens est un nombre
cometeSens vaut 1
msgTxt est un texte
msgTxt vaut ""
msgVie est un nombre
// le decor
ptsAst est un tableau
ptsEtoile est un tableau
formeAst est un tableau
pour ki de 0 à 15
ptsAst ajoute 0
ptsAst ajoute 0
formeAst ajoute 0.86 + hasard(0, 26) / 100
fin pour
pour ki de 0 à 19
ptsEtoile ajoute 0
fin pour
ciX, ciY, ciB est un tableau
pour ki de 0 à 69
ciX ajoute hasard(2, 288)
ciY ajoute hasard(2, 548)
ciB ajoute hasard(0, 30)
fin pour
// textes qui s'envolent et eclats de roche
ftX, ftY, ftVie, ftTxt est un tableau
pour ki de 0 à 11
ftX ajoute 0
ftY ajoute 0
ftVie ajoute 0
ftTxt ajoute ""
fin pour
ftProchain est un nombre
frX, frY, frVX, frVY, frVie est un tableau
pour ki de 0 à 29
frX ajoute 0
frY ajoute 0
frVX ajoute 0
frVY ajoute 0
frVie ajoute 0
fin pour
frProchain est un nombre
// la file des ordres
ordres, ordX, ordY est un tableau
pour ki de 0 à 31
ordres ajoute 0
ordX ajoute 0
ordY ajoute 0
fin pour
teteO, queueO est un nombre
action, sourisX, sourisY est un nombre
@ LE TEXTE
procédure centrer(txt, xMil, yTxt, coul, taillePolice)
label(ecran, xMil - label_largeur(txt, taillePolice) / 2, yTxt, txt, coul, taillePolice)
fin procédure
procédure aDroite(txt, xFin, yTxt, coul, taillePolice)
label(ecran, xFin - label_largeur(txt, taillePolice), yTxt, txt, coul, taillePolice)
fin procédure
procédure bouton(x, y, l, hb, txt, fond, coulTxt, taillePolice)
rectangle_arrondi(ecran, x, y + 3, l, hb, 10, rgba(0, 0, 0, 0.3))
rectangle_arrondi(ecran, x, y, l, hb, 10, fond)
appelle centrer(txt, x + l / 2, y + hb / 2 + taillePolice * 0.38, coulTxt, taillePolice)
fin procédure
// 1234567 -> "1,23 M"
fonction nombreTexte(v)
si v < 1000 alors
retourne convertir_texte(arrondi_inferieur(v))
fin si
w est un nombre
w vaut v
e est un nombre
e vaut 0
tant que w >= 1000 et e < 9
w vaut w / 1000
e vaut e + 1
fin tant que
t est un texte
si w < 10 alors
t vaut convertir_texte(arrondi_inferieur(w * 100) / 100)
sinon si w < 100 alors
t vaut convertir_texte(arrondi_inferieur(w * 10) / 10)
sinon
t vaut convertir_texte(arrondi_inferieur(w))
fin si
retourne remplacer(t, ".", ",") + " " + SUFFIXES[e - 1]
fin fonction
// pour les petites productions : 0,1 ou 2,5
fonction nombreProd(v)
si v < 100 alors
retourne remplacer(convertir_texte(arrondi_inferieur(v * 10) / 10), ".", ",")
fin si
retourne nombreTexte(v)
fin fonction
fonction dureeTexte(sec)
s est un nombre
s vaut arrondi_inferieur(limiter(sec, 0, 100000000))
si s < 60 alors
retourne convertir_texte(s) + " s"
fin si
hh est un nombre
hh vaut arrondi_inferieur(s / 3600)
mi est un nombre
mi vaut arrondi_inferieur((s mod 3600) / 60)
si hh = 0 alors
retourne convertir_texte(mi) + " min"
fin si
retourne convertir_texte(hh) + " h " + convertir_texte(mi) + " min"
fin fonction
@ LA PRODUCTION
fonction bonusEtoiles()
retourne 1 + etoiles * 0.1
fin fonction
fonction prodMachine(p)
base est un nombre
base vaut PROD_M[p] * possedes[p] * puissance(2, nivMachine[p])
si base > 0 alors
// on divise par le bonus (toujours >= 1) pour ne jamais depasser 2^53
si base > PLAFOND / bonusEtoiles() alors
retourne PLAFOND
fin si
fin si
retourne base * bonusEtoiles()
fin fonction
fonction prodSec()
s est un nombre
s vaut 0
p est un nombre
pour p de 0 à 7
s vaut minimum(s + prodMachine(p), PLAFOND)
fin pour
si frenesie > 0 alors
s vaut minimum(s, PLAFOND / 7) * 7
fin si
retourne s
fin fonction
fonction valeurClic()
retourne minimum(puissance(2, nivClic) * bonusEtoiles() + prodSec() * 0.02 * nivClic, PLAFOND)
fin fonction
// prix de n machines de type p
// (renvoie PLAFOND quand c'est hors de portee, sans jamais depasser 2^53)
fonction prix(p, n)
si possedes[p] > 220 alors
retourne PLAFOND
fin si
unite est un nombre
unite vaut puissance(1.15, possedes[p])
si unite > PLAFOND / PRIX_M[p] alors
retourne PLAFOND
fin si
unite vaut unite * PRIX_M[p]
facteur est un nombre
facteur vaut (puissance(1.15, n) - 1) / 0.15
si unite > PLAFOND / facteur alors
retourne PLAFOND
fin si
retourne minimum(arrondi_superieur(unite * facteur), PLAFOND)
fin fonction
fonction machineVisible(p)
si p = 0 ou possedes[p] > 0 alors
retourne vrai
fin si
si totalPartie >= PRIX_M[p] * 0.4 alors
retourne vrai
fin si
retourne faux
fin fonction
fonction etoilesGagnables()
retourne arrondi_inferieur(racine(totalPartie / SEUIL_SAUT))
fin fonction
@ LES AMELIORATIONS PROPOSEES
fonction amelVisible(k)
si upAchete[k] alors
retourne faux
fin si
si upType[k] >= 0 alors
si possedes[upType[k]] >= upSeuil[k] alors
retourne vrai
fin si
retourne faux
fin si
// les ameliorations du clic arrivent dans l'ordre
si k > PREMIER_CLIC alors
si non upAchete[k - 1] alors
retourne faux
fin si
fin si
si totalPartie >= upCout[k] * 0.3 alors
retourne vrai
fin si
retourne faux
fin fonction
procédure listerAmel()
k est un nombre
pour k de 0 à NB_AMEL - 1
dejaPris[k] vaut faux
fin pour
nbDispo vaut 0
rang est un nombre
pour rang de 0 à 7
meilleurK est un nombre
meilleurK vaut -1
pour k de 0 à NB_AMEL - 1
si non dejaPris[k] alors
si amelVisible(k) alors
si meilleurK = -1 alors
meilleurK vaut k
sinon si upCout[k] < upCout[meilleurK] alors
meilleurK vaut k
fin si
fin si
fin si
fin pour
si meilleurK >= 0 alors
dejaPris[meilleurK] vaut vrai
dispoK[nbDispo] vaut meilleurK
nbDispo vaut nbDispo + 1
fin si
fin pour
fin procédure
fonction nbAmelAchetables()
n est un nombre
n vaut 0
k est un nombre
si nbDispo > 0 alors
pour k de 0 à nbDispo - 1
si cristaux >= upCout[dispoK[k]] alors
n vaut n + 1
fin si
fin pour
fin si
retourne n
fin fonction
@ SAUVEGARDE
// chaque morceau de la date est verifie avant le calcul :
// si l'un d'eux est bizarre, on renonce au gain d'absence
procédure lireHorloge()
horodatage vaut 0
essayer
an est un nombre
an vaut annee_de(maintenant())
mo est un nombre
mo vaut mois_de(maintenant())
jo est un nombre
jo vaut jour_de(maintenant())
hr est un nombre
hr vaut heure_de(maintenant())
mn est un nombre
mn vaut minute_de(maintenant())
sd est un nombre
sd vaut seconde_de(maintenant())
valide est un booléen
valide vaut vrai
si an < 2000 ou an > 2200 ou mo < 1 ou mo > 12 ou jo < 1 ou jo > 31 alors
valide vaut faux
fin si
si hr < 0 ou hr > 23 ou mn < 0 ou mn > 59 ou sd < 0 ou sd > 59 alors
valide vaut faux
fin si
si valide alors
horodatage vaut (((an - 2000) * 12 + mo) * 31 + jo) * 86400 + hr * 3600 + mn * 60 + sd
fin si
attraper
horodatage vaut 0
fin essayer
fin procédure
procédure sauverPartie()
appelle lireHorloge()
marques est un texte
marques vaut ""
k est un nombre
pour k de 0 à NB_AMEL - 1
si upAchete[k] alors
marques vaut marques + "1"
sinon
marques vaut marques + "0"
fin si
fin pour
essayer
parametre('astrofilon', 'cristaux', cristaux)
parametre('astrofilon', 'totalPartie', totalPartie)
parametre('astrofilon', 'totalTout', totalTout)
parametre('astrofilon', 'etoiles', etoiles)
parametre('astrofilon', 'ameliorations', marques)
parametre('astrofilon', 'horloge', horodatage)
pour k de 0 à 7
parametre('astrofilon', 'm' + convertir_texte(k), possedes[k])
fin pour
attraper
msgVie vaut 0
fin essayer
fin procédure
procédure charger()
essayer
cristaux vaut parametre('astrofilon', 'cristaux')
totalPartie vaut parametre('astrofilon', 'totalPartie')
totalTout vaut parametre('astrofilon', 'totalTout')
etoiles vaut parametre('astrofilon', 'etoiles')
k est un nombre
pour k de 0 à 7
possedes[k] vaut parametre('astrofilon', 'm' + convertir_texte(k))
fin pour
marques est un texte
marques vaut parametre('astrofilon', 'ameliorations')
pour k de 0 à NB_AMEL - 1
si copier(marques, k + 1, 1) = "1" alors
upAchete[k] vaut vrai
si upType[k] >= 0 alors
nivMachine[upType[k]] vaut nivMachine[upType[k]] + 1
sinon
nivClic vaut nivClic + 1
fin si
fin si
fin pour
introVue vaut vrai
ancien est un nombre
ancien vaut 0
essayer
ancien vaut parametre('astrofilon', 'horloge')
attraper
ancien vaut 0
fin essayer
appelle lireHorloge()
// les machines ont mine pendant l'absence (a moitie, 8 heures au plus)
si ancien < 0 ou ancien > 1000000000000 alors
ancien vaut 0
fin si
// on ne compte que les absences de plus d'une minute et de moins de 60 jours
si ancien > 0 et horodatage > ancien + 60 et horodatage < ancien + 5184000 alors
dureeAbsence vaut horodatage - ancien
gainAbsence vaut minimum(prodSec(), PLAFOND / 14400) * minimum(dureeAbsence, 28800) * 0.5
si gainAbsence >= 1 alors
cristaux vaut minimum(cristaux + gainAbsence, PLAFOND)
totalPartie vaut minimum(totalPartie + gainAbsence, PLAFOND)
totalTout vaut minimum(totalTout + gainAbsence, PLAFOND)
etat vaut 5
sinon
etat vaut 1
fin si
sinon
etat vaut 1
fin si
attraper
etat vaut 6
fin essayer
fin procédure
@ LES ACTIONS
procédure annoncer(txt)
msgTxt vaut txt
msgVie vaut 3
fin procédure
procédure ajouterCristaux(v)
w est un nombre
w vaut minimum(v, PLAFOND)
cristaux vaut minimum(cristaux + w, PLAFOND)
totalPartie vaut minimum(totalPartie + w, PLAFOND)
totalTout vaut minimum(totalTout + w, PLAFOND)
fin procédure
procédure acheterMachine(p)
cout est un nombre
cout vaut prix(p, quantite)
si cristaux >= cout et cout < PLAFOND alors
cristaux vaut cristaux - cout
possedes[p] vaut possedes[p] + quantite
fin si
fin procédure
procédure acheterAmel(k)
si cristaux >= upCout[k] alors
cristaux vaut cristaux - upCout[k]
upAchete[k] vaut vrai
si upType[k] >= 0 alors
nivMachine[upType[k]] vaut nivMachine[upType[k]] + 1
appelle annoncer(NOMS_M[upType[k]] + " : production x2 !")
sinon
nivClic vaut nivClic + 1
appelle annoncer("Tes clics sont plus puissants !")
fin si
fin si
fin procédure
procédure lancerTexte(x, y, txt)
ftX[ftProchain] vaut x
ftY[ftProchain] vaut y
ftVie[ftProchain] vaut 1
ftTxt[ftProchain] vaut txt
ftProchain vaut (ftProchain + 1) mod 12
fin procédure
procédure lancerEclat(x, y)
frX[frProchain] vaut x
frY[frProchain] vaut y
frVX[frProchain] vaut hasard(-60, 60) / 10
frVY[frProchain] vaut hasard(-70, 10) / 10
frVie[frProchain] vaut 1
frProchain vaut (frProchain + 1) mod 30
fin procédure
procédure cliquerAsteroide(x, y)
v est un nombre
v vaut valeurClic()
appelle ajouterCristaux(v)
choc vaut 1
appelle lancerTexte(x, y - 10, "+" + nombreProd(v))
ke est un nombre
pour ke de 0 à 2
appelle lancerEclat(x, y)
fin pour
fin procédure
fonction cometeX()
u est un nombre
u vaut 1 - cometeVie / 12
si cometeSens = 1 alors
retourne -30 + u * 350
fin si
retourne 320 - u * 350
fin fonction
fonction cometeY()
u est un nombre
u vaut 1 - cometeVie / 12
retourne cometeY0 + sinus(u * 6) * 30
fin fonction
procédure attraperComete()
cx est un nombre
cx vaut cometeX()
cy est un nombre
cy vaut cometeY()
si hasard(0, 1) = 0 ou prodSec() < 1 alors
gain est un nombre
gain vaut minimum(cristaux * 0.15, minimum(prodSec(), PLAFOND / 900) * 900) + 50
appelle ajouterCristaux(gain)
appelle annoncer("Pluie de cristaux : +" + nombreTexte(gain) + " !")
appelle lancerTexte(cx, cy, "+" + nombreTexte(gain))
sinon
frenesie vaut 30
appelle annoncer("Frénésie : production x7 pendant 30 s !")
fin si
ke est un nombre
pour ke de 0 à 7
appelle lancerEclat(cx, cy)
fin pour
cometeVie vaut 0
fin procédure
procédure faireSaut()
etoilesSaut vaut etoilesGagnables()
etoiles vaut etoiles + etoilesSaut
cristaux vaut 0
totalPartie vaut 0
nivClic vaut 0
frenesie vaut 0
k est un nombre
pour k de 0 à 7
possedes[k] vaut 0
nivMachine[k] vaut 0
fin pour
pour k de 0 à NB_AMEL - 1
upAchete[k] vaut faux
fin pour
onglet vaut 0
sautAnim vaut 2
etat vaut 7
appelle sauverPartie()
fin procédure
@ LE TEMPS QUI PASSE
procédure avancer(dt)
appelle ajouterCristaux(prodSec() * dt)
si frenesie > 0 alors
frenesie vaut frenesie - dt
fin si
si cometeVie > 0 alors
cometeVie vaut cometeVie - dt
sinon
cometeAttente vaut cometeAttente - dt
si cometeAttente <= 0 alors
cometeVie vaut 12
cometeSens vaut hasard(0, 1)
cometeY0 vaut hasard(130, 400)
cometeAttente vaut hasard(60, 120)
fin si
fin si
si msgVie > 0 alors
msgVie vaut msgVie - dt
fin si
si sautAnim > 0 alors
sautAnim vaut sautAnim - dt
si sautAnim <= 0 et etat = 7 alors
etat vaut 1
appelle annoncer("Bienvenue dans une nouvelle galaxie !")
fin si
fin si
choc vaut choc * 0.6
k est un nombre
pour k de 0 à 11
si ftVie[k] > 0 alors
ftVie[k] vaut ftVie[k] - dt * 1.2
ftY[k] vaut ftY[k] - dt * 50
fin si
fin pour
pour k de 0 à 29
si frVie[k] > 0 alors
frVie[k] vaut frVie[k] - dt * 1.5
frX[k] vaut frX[k] + frVX[k] * dt * 16
frY[k] vaut frY[k] + frVY[k] * dt * 16
frVY[k] vaut frVY[k] + dt * 9
fin si
fin pour
fin procédure
@ DESSIN DES PETITS OBJETS
procédure dessinerCristal(x, y, s)
polygone(ecran, x, y - 9 * s, x + 6 * s, y - 2 * s, x, y + 9 * s, x - 6 * s, y - 2 * s, #22D3EE)
polygone(ecran, x, y - 9 * s, x + 6 * s, y - 2 * s, x, y + 1 * s, #A5F3FC)
polygone(ecran, x, y - 9 * s, x - 6 * s, y - 2 * s, x - 2 * s, y - 2 * s, #ECFEFF)
fin procédure
procédure dessinerEtoile(x, y, r, coul)
k est un nombre
pour k de 0 à 9
ang est un nombre
ang vaut -pi() / 2 + k * pi() / 5
rr est un nombre
rr vaut r
si k mod 2 = 1 alors
rr vaut r * 0.45
fin si
ptsEtoile[k * 2] vaut x + cosinus(ang) * rr
ptsEtoile[k * 2 + 1] vaut y + sinus(ang) * rr
fin pour
polygone(ecran, ptsEtoile, coul)
fin procédure
// l'icone d'une machine, centree en (cx, cy)
procédure dessinerIcone(p, cx, cy, cache)
c est un texte
c vaut COUL_M[p]
gris est un texte
gris vaut #CBD5E1
si cache alors
c vaut #334155
gris vaut #334155
fin si
si p = 0 alors
ligne(ecran, cx - 10, cy + 11, cx + 3, cy - 2, gris, 4)
polygone(ecran, cx - 6, cy - 9, cx + 10, cy - 12, cx + 9, cy + 4, cx + 3, cy - 2, c)
cercle(ecran, cx + 11, cy - 13, 3, #FFFFFF)
sinon si p = 1 alors
rectangle_arrondi(ecran, cx - 12, cy - 9, 18, 18, 4, c)
rectangle(ecran, cx - 9, cy - 5, 12, 5, #1E293B)
cercle(ecran, cx - 6, cy - 3, 1.5, #38BDF8)
cercle(ecran, cx, cy - 3, 1.5, #38BDF8)
polygone(ecran, cx + 6, cy - 6, cx + 6, cy + 6, cx + 15, cy, gris)
rectangle(ecran, cx - 12, cy + 9, 18, 3, gris)
sinon si p = 2 alors
ligne(ecran, cx - 11, cy - 7, cx + 11, cy + 7, gris, 2)
ligne(ecran, cx - 11, cy + 7, cx + 11, cy - 7, gris, 2)
ellipse(ecran, cx - 11, cy - 8, 6, 2, c)
ellipse(ecran, cx + 11, cy - 8, 6, 2, c)
ellipse(ecran, cx - 11, cy + 8, 6, 2, c)
ellipse(ecran, cx + 11, cy + 8, 6, 2, c)
cercle(ecran, cx, cy, 6, c)
cercle(ecran, cx, cy, 2.5, #FFFFFF)
sinon si p = 3 alors
polygone(ecran, cx - 14, cy - 3, cx - 19, cy, cx - 14, cy + 3, #FB923C)
polygone(ecran, cx - 14, cy - 7, cx + 6, cy - 7, cx + 15, cy, cx + 6, cy + 7, cx - 14, cy + 7, c)
rectangle(ecran, cx - 10, cy - 3, 12, 6, gris)
cercle(ecran, cx + 7, cy, 2.5, #E0F2FE)
sinon si p = 4 alors
rectangle(ecran, cx - 16, cy - 4, 8, 8, #38BDF8)
rectangle(ecran, cx + 8, cy - 4, 8, 8, #38BDF8)
ellipse(ecran, cx, cy, 13, 6, c)
ellipse(ecran, cx, cy, 9, 3, #0B1226)
cercle(ecran, cx, cy - 2, 6, gris)
cercle(ecran, cx - 2, cy - 4, 2, #FFFFFF)
sinon si p = 5 alors
cercle(ecran, cx + 9, cy - 15, 3, rgba(203, 213, 225, 0.5))
cercle(ecran, cx + 12, cy - 19, 2, rgba(203, 213, 225, 0.35))
rectangle(ecran, cx + 5, cy - 12, 6, 10, gris)
polygone(ecran, cx - 13, cy - 2, cx - 4, cy - 8, cx - 4, cy - 2, cx + 13, cy - 2, cx + 13, cy + 11, cx - 13, cy + 11, c)
rectangle(ecran, cx - 8, cy + 3, 4, 4, #FEF3C7)
rectangle(ecran, cx + 2, cy + 3, 4, 4, #FEF3C7)
sinon si p = 6 alors
k est un nombre
pour k de 0 à 7
ligne(ecran, cx + cosinus(k * pi() / 4) * 9, cy + sinus(k * pi() / 4) * 9, cx + cosinus(k * pi() / 4) * 15, cy + sinus(k * pi() / 4) * 15, c, 2)
fin pour
cercle(ecran, cx, cy, 9, c)
cercle(ecran, cx, cy, 5, #FEF3C7)
sinon
cercle(ecran, cx, cy, 14, c)
cercle(ecran, cx, cy, 10, #0B1226)
cercle(ecran, cx, cy, 7, c)
cercle(ecran, cx, cy, 3.5, #FFFFFF)
fin si
fin procédure
procédure dessinerMain(cx, cy)
// un curseur en forme de fleche pour les ameliorations du clic
polygone(ecran, cx - 7, cy - 12, cx + 8, cy + 2, cx + 1, cy + 3, cx + 5, cy + 11, cx + 1, cy + 13, cx - 3, cy + 5, cx - 7, cy + 9, #F8FAFC)
cercle(ecran, cx + 9, cy - 9, 3, #22D3EE)
fin procédure
@ DESSIN DE L'ESPACE
procédure dessinerOrbite(devant)
// robots, drones et cargos tournent autour de l'asteroide
nbR est un nombre
nbR vaut minimum(possedes[1], 5)
nbD est un nombre
nbD vaut minimum(possedes[2], 5)
nbC est un nombre
nbC vaut minimum(possedes[3], 4)
total est un nombre
total vaut nbR + nbD + nbC
si total > 0 alors
k est un nombre
pour k de 0 à total - 1
ang est un nombre
ang vaut tic * 0.025 + k * 2 * pi() / total
ox est un nombre
ox vaut AST_X + cosinus(ang) * 118
oy est un nombre
oy vaut AST_Y + sinus(ang) * 34 - cosinus(ang) * 14
estDevant est un nombre
estDevant vaut 0
si sinus(ang) > 0 alors
estDevant vaut 1
fin si
si estDevant = devant alors
ombre est un nombre
ombre vaut 1
si estDevant = 0 alors
ombre vaut 0.55
fin si
si k < nbR alors
rectangle_arrondi(ecran, ox - 5, oy - 5, 10, 10, 2, rgba(251, 191, 36, ombre))
rectangle(ecran, ox - 3, oy - 2, 6, 2, #1E293B)
sinon si k < nbR + nbD alors
ligne(ecran, ox - 7, oy - 3, ox + 7, oy - 3, rgba(203, 213, 225, ombre), 1.5)
cercle(ecran, ox, oy, 4, rgba(52, 211, 153, ombre))
sinon
polygone(ecran, ox - 8, oy - 4, ox + 8, oy, ox - 8, oy + 4, rgba(96, 165, 250, ombre))
cercle(ecran, ox - 9, oy, 2, #FB923C)
fin si
fin si
fin pour
fin si
fin procédure
procédure dessinerAsteroide()
ech est un nombre
ech vaut 1 - choc * 0.06
rot est un nombre
rot vaut tic * 0.006
k est un nombre
// le halo
cercle(ecran, AST_X, AST_Y, AST_R * 1.35, rgba(34, 211, 238, 0.05))
cercle(ecran, AST_X, AST_Y, AST_R * 1.18, rgba(34, 211, 238, 0.07))
pour k de 0 à 15
ang est un nombre
ang vaut rot + k * pi() / 8
ptsAst[k * 2] vaut AST_X + cosinus(ang) * AST_R * formeAst[k] * ech
ptsAst[k * 2 + 1] vaut AST_Y + sinus(ang) * AST_R * formeAst[k] * ech
fin pour
polygone(ecran, ptsAst, #57534E)
pour k de 0 à 15
ang est un nombre
ang vaut rot + k * pi() / 8
ptsAst[k * 2] vaut AST_X - 7 + cosinus(ang) * AST_R * formeAst[k] * ech * 0.84
ptsAst[k * 2 + 1] vaut AST_Y - 7 + sinus(ang) * AST_R * formeAst[k] * ech * 0.84
fin pour
polygone(ecran, ptsAst, #78716C)
// les crateres
pour k de 0 à 5
ang est un nombre
ang vaut rot + k * 1.07
dist est un nombre
dist vaut AST_R * ech * (0.25 + (k mod 3) * 0.17)
rc est un nombre
rc vaut (7 + (k mod 3) * 3) * ech
crx est un nombre
crx vaut AST_X - 5 + cosinus(ang) * dist
cry est un nombre
cry vaut AST_Y - 5 + sinus(ang) * dist
ellipse(ecran, crx, cry, rc, rc * 0.8, #57534E)
ellipse(ecran, crx + 1.5, cry + 1.5, rc * 0.75, rc * 0.6, #44403C)
fin pour
// les cristaux qui depassent
pour k de 0 à 4
ang est un nombre
ang vaut rot + k * 1.26 + 0.3
dist est un nombre
dist vaut AST_R * ech * 0.62
appelle dessinerCristal(AST_X - 4 + cosinus(ang) * dist, AST_Y - 4 + sinus(ang) * dist, 0.9 + (k mod 2) * 0.4)
fin pour
fin procédure
procédure dessinerLasers()
nb est un nombre
nb vaut minimum(possedes[0], 10)
si nb > 0 alors
k est un nombre
pour k de 0 à nb - 1
ang est un nombre
ang vaut k * 2 * pi() / nb + 0.4 - tic * 0.01
lx est un nombre
lx vaut AST_X + cosinus(ang) * 100
ly est un nombre
ly vaut AST_Y + sinus(ang) * 100
si (tic + k * 7) mod 24 < 6 alors
ligne(ecran, lx, ly, AST_X + cosinus(ang) * 60, AST_Y + sinus(ang) * 60, rgba(248, 113, 113, 0.85), 2)
cercle(ecran, AST_X + cosinus(ang) * 60, AST_Y + sinus(ang) * 60, 3, #FECACA)
fin si
cercle(ecran, lx, ly, 4, #F87171)
cercle(ecran, lx, ly, 1.8, #FFFFFF)
fin pour
fin si
fin procédure
procédure dessinerComete()
si cometeVie > 0 alors
cx est un nombre
cx vaut cometeX()
cy est un nombre
cy vaut cometeY()
dirX est un nombre
dirX vaut -1
si cometeSens = 0 alors
dirX vaut 1
fin si
k est un nombre
pour k de 1 à 8
cercle(ecran, cx + dirX * k * 7, cy - sinus((1 - cometeVie / 12) * 6 - k * 0.1) * 3, 11 - k, rgba(253, 224, 71, 0.45 - k * 0.05))
fin pour
cercle(ecran, cx, cy, 17, rgba(253, 224, 71, 0.25 + (tic mod 6) * 0.04))
cercle(ecran, cx, cy, 11, #FACC15)
cercle(ecran, cx - 3, cy - 3, 5, #FEF9C3)
fin si
fin procédure
procédure dessinerEspace()
rectangle(ecran, 0, 0, PANNEAU_X, 550, #070B1A)
cercle(ecran, 60, 470, 200, rgba(76, 29, 149, 0.18))
cercle(ecran, 250, 120, 150, rgba(14, 116, 144, 0.14))
k est un nombre
pour k de 0 à 69
br est un nombre
br vaut 0.3 + ((tic + ciB[k] * 3) mod 40) / 60
rr est un nombre
rr vaut 1
si k mod 9 = 0 alors
rr vaut 1.8
fin si
cercle(ecran, ciX[k], ciY[k], rr, rgba(255, 255, 255, br))
fin pour
// une planete au loin
cercle(ecran, 252, 436, 34, #9A3412)
cercle(ecran, 246, 430, 27, #C2410C)
ellipse(ecran, 252, 440, 56, 7, rgba(254, 215, 170, 0.5))
ellipse(ecran, 252, 440, 46, 4, #070B1A)
cercle(ecran, 240, 424, 9, rgba(255, 237, 213, 0.35))
fin procédure
procédure dessinerGauche()
appelle dessinerEspace()
appelle dessinerOrbite(0)
appelle dessinerLasers()
appelle dessinerAsteroide()
appelle dessinerOrbite(1)
appelle dessinerComete()
k est un nombre
pour k de 0 à 29
si frVie[k] > 0 alors
cercle(ecran, frX[k], frY[k], 2 + frVie[k] * 2, rgba(165, 243, 252, frVie[k]))
fin si
fin pour
pour k de 0 à 11
si ftVie[k] > 0 alors
appelle centrer(ftTxt[k], ftX[k], ftY[k], rgba(255, 255, 255, limiter(ftVie[k], 0, 1)), 16)
fin si
fin pour
// le compteur
rectangle_arrondi(ecran, 14, 10, 262, 76, 16, rgba(15, 23, 42, 0.75))
txt est un texte
txt vaut nombreTexte(cristaux)
lt est un nombre
lt vaut label_largeur(txt, 26)
appelle dessinerCristal(145 - lt / 2 - 14, 40, 1.3)
label(ecran, 145 - lt / 2 + 4, 50, txt, #F8FAFC, 26)
coulProd est un texte
coulProd vaut #94A3B8
si frenesie > 0 alors
coulProd vaut #FACC15
fin si
appelle centrer("cristaux · " + nombreProd(prodSec()) + " par seconde", 145, 74, coulProd, 12)
si frenesie > 0 alors
rectangle_arrondi(ecran, 40, 96, 210, 22, 11, rgba(250, 204, 21, 0.2))
rectangle_arrondi(ecran, 40, 96, 210 * limiter(frenesie / 30, 0, 1), 22, 11, rgba(250, 204, 21, 0.55))
appelle centrer("Frénésie x7 · " + convertir_texte(arrondi_superieur(frenesie)) + " s", 145, 112, #FEF9C3, 12)
fin si
si msgVie > 0 alors
appelle centrer(msgTxt, 145, 382, rgba(254, 249, 195, limiter(msgVie, 0, 1)), 12)
sinon si totalTout < 30 alors
appelle centrer("Clique sur l'astéroïde !", 145, 382, rgba(165, 243, 252, 0.6 + (tic mod 10) * 0.04), 14)
fin si
// le saut hyperspatial
gainE est un nombre
gainE vaut etoilesGagnables()
si gainE >= 1 alors
appelle bouton(20, 470, 250, 36, "Saut hyperspatial : +" + convertir_texte(gainE) + " étoile" + sialors(gainE > 1, "s", ""), sialors(tic mod 16 < 8, #7C3AED, #6D28D9), #FFFFFF, 13)
sinon
appelle bouton(20, 470, 250, 36, "Saut hyperspatial dès " + nombreTexte(SEUIL_SAUT) + " extraits", #1E1B4B, #6B7280, 12)
fin si
appelle dessinerEtoile(30, 528, 8, #FACC15)
label(ecran, 44, 533, convertir_texte(etoiles) + " étoile" + sialors(etoiles > 1, "s", "") + " · production +" + convertir_texte(etoiles * 10) + " %", #CBD5E1, 12)
fin procédure
@ DESSIN DE LA BOUTIQUE
procédure dessinerOnglets()
fond1 est un texte
fond1 vaut #1E293B
fond2 est un texte
fond2 vaut #1E293B
si onglet = 0 alors
fond1 vaut #0891B2
sinon
fond2 vaut #0891B2
fin si
appelle bouton(300, 10, 118, 32, "Machines", fond1, #FFFFFF, 13)
appelle bouton(426, 10, 124, 32, "Améliorations", fond2, #FFFFFF, 13)
n est un nombre
n vaut nbAmelAchetables()
si n > 0 alors
cercle(ecran, 546, 12, 10, #22C55E)
appelle centrer(convertir_texte(n), 546, 16, #FFFFFF, 11)
fin si
fin procédure
procédure dessinerMachines()
p est un nombre
pour p de 0 à 7
y est un nombre
y vaut 52 + p * 52
visible est un booléen
visible vaut machineVisible(p)
cout est un nombre
cout vaut prix(p, quantite)
assez est un booléen
assez vaut faux
si cristaux >= cout et cout < PLAFOND alors
assez vaut vrai
fin si
fondR est un texte
fondR vaut #121A35
si visible et assez alors
fondR vaut #1C2D5C
fin si
rectangle_arrondi(ecran, 298, y, 254, 48, 10, fondR)
rectangle_arrondi(ecran, 302, y + 4, 40, 40, 8, #0B1226)
cache est un booléen
cache vaut vrai
si visible alors
cache vaut faux
fin si
appelle dessinerIcone(p, 322, y + 24, cache)
si visible alors
label(ecran, 350, y + 19, NOMS_M[p], #F1F5F9, 13)
appelle dessinerCristal(356, y + 33, 0.6)
coulPrix est un texte
coulPrix vaut #F87171
si assez alors
coulPrix vaut #4ADE80
fin si
txtQ est un texte
txtQ vaut ""
si quantite > 1 alors
txtQ vaut " (x" + convertir_texte(quantite) + ")"
fin si
si cout >= PLAFOND alors
label(ecran, 364, y + 38, "hors de portée", #64748B, 12)
sinon
label(ecran, 364, y + 38, nombreTexte(cout) + txtQ, coulPrix, 12)
fin si
appelle aDroite(convertir_texte(possedes[p]), 546, y + 28, rgba(241, 245, 249, 0.45), 22)
si possedes[p] > 0 alors
appelle aDroite("+" + nombreProd(prodMachine(p)) + "/s", 546, y + 42, #64748B, 9)
fin si
sinon
label(ecran, 350, y + 28, "???", #475569, 15)
label(ecran, 386, y + 28, "à découvrir", #334155, 11)
fin si
fin pour
fin procédure
procédure dessinerAmeliorations()
si nbDispo = 0 alors
appelle centrer("Achète des machines pour", 425, 230, #64748B, 13)
appelle centrer("débloquer des améliorations", 425, 250, #64748B, 13)
sinon
r est un nombre
pour r de 0 à nbDispo - 1
k est un nombre
k vaut dispoK[r]
y est un nombre
y vaut 52 + r * 52
assez est un booléen
assez vaut faux
si cristaux >= upCout[k] alors
assez vaut vrai
fin si
fondR est un texte
fondR vaut #121A35
si assez alors
fondR vaut #1C2D5C
fin si
rectangle_arrondi(ecran, 298, y, 254, 48, 10, fondR)
rectangle_arrondi(ecran, 302, y + 4, 40, 40, 8, #0B1226)
effet est un texte
si upType[k] >= 0 alors
appelle dessinerIcone(upType[k], 322, y + 24, faux)
effet vaut NOMS_M[upType[k]] + " x2"
sinon
appelle dessinerMain(322, y + 24)
effet vaut "Clic x2 · +2 % de la prod."
fin si
label(ecran, 350, y + 19, upNom[k], #F1F5F9, 12)
label(ecran, 350, y + 37, effet, #94A3B8, 10)
coulPrix est un texte
coulPrix vaut #F87171
si assez alors
coulPrix vaut #4ADE80
fin si
appelle aDroite(nombreTexte(upCout[k]), 546, y + 28, coulPrix, 12)
fin pour
fin si
fin procédure
procédure dessinerBoutique()
rectangle(ecran, PANNEAU_X, 0, 270, 550, #0B1226)
ligne(ecran, PANNEAU_X, 0, PANNEAU_X, 550, #1E3A5F, 2)
appelle dessinerOnglets()
si onglet = 0 alors
appelle dessinerMachines()
label(ecran, 302, 497, "Acheter", #94A3B8, 12)
q est un nombre
pour q de 0 à 2
valQ est un nombre
valQ vaut puissance(10, q)
fondQ est un texte
fondQ vaut #1E293B
si quantite = valQ alors
fondQ vaut #0891B2
fin si
appelle bouton(360 + q * 64, 478, 56, 28, "x" + convertir_texte(valQ), fondQ, #FFFFFF, 12)
fin pour
sinon
appelle dessinerAmeliorations()
fin si
appelle centrer("Total extrait : " + nombreTexte(totalTout), 425, 535, #475569, 11)
fin procédure
@ LES FENETRES
procédure voile()
rectangle(ecran, 0, 0, 560, 550, rgba(2, 6, 23, 0.75))
fin procédure
procédure fenetre(y, hf)
rectangle_arrondi(ecran, 50, y + 4, 460, hf, 20, rgba(0, 0, 0, 0.4))
rectangle_arrondi(ecran, 50, y, 460, hf, 20, #0F1A36)
rectangle_arrondi(ecran, 50, y, 460, 6, 3, #22D3EE)
fin procédure
procédure ecranAccueil()
appelle voile()
appelle fenetre(70, 410)
appelle dessinerCristal(150, 116, 1.6)
appelle dessinerCristal(410, 116, 1.6)
appelle centrer("Astro Filon", 280, 128, #F8FAFC, 34)
appelle centrer("La grande mine de l'espace", 280, 152, #67E8F9, 14)
label(ecran, 82, 196, "Clique sur l'astéroïde pour extraire des cristaux.", #E2E8F0, 13)
label(ecran, 82, 226, "Achète des machines : elles minent toutes seules,", #E2E8F0, 13)
label(ecran, 82, 244, "même quand tu ne joues pas.", #E2E8F0, 13)
label(ecran, 82, 274, "Les améliorations doublent la production.", #E2E8F0, 13)
label(ecran, 82, 304, "Attrape les comètes dorées pour un gros bonus.", #E2E8F0, 13)
label(ecran, 82, 334, "Le saut hyperspatial recommence la partie, mais", #E2E8F0, 13)
label(ecran, 82, 352, "chaque étoile gagnée ajoute 10 % de production.", #E2E8F0, 13)
cercle(ecran, 68, 192, 3, #22D3EE)
cercle(ecran, 68, 222, 3, #22D3EE)
cercle(ecran, 68, 270, 3, #22D3EE)
cercle(ecran, 68, 300, 3, #FACC15)
cercle(ecran, 68, 330, 3, #A78BFA)
appelle bouton(190, 396, 180, 50, "C'est parti !", sialors(tic mod 16 < 8, #0891B2, #0E7490), #FFFFFF, 18)
fin procédure
procédure ecranRetour()
appelle voile()
appelle fenetre(140, 270)
appelle centrer("Bon retour, capitaine !", 280, 190, #F8FAFC, 24)
appelle centrer("Pendant ton absence (" + dureeTexte(dureeAbsence) + "),", 280, 226, #94A3B8, 13)
appelle centrer("tes machines ont extrait", 280, 246, #94A3B8, 13)
appelle dessinerCristal(170, 282, 1.4)
appelle centrer("+" + nombreTexte(gainAbsence), 290, 294, #67E8F9, 30)
appelle bouton(200, 330, 160, 46, "Récupérer", #0891B2, #FFFFFF, 16)
fin procédure
procédure ecranSaut()
appelle voile()
appelle fenetre(120, 310)
appelle dessinerEtoile(280, 170, 22, #FACC15)
appelle centrer("Saut hyperspatial", 280, 226, #F8FAFC, 24)
gainE est un nombre
gainE vaut etoilesGagnables()
appelle centrer("Tu gagnes +" + convertir_texte(gainE) + " étoile" + sialors(gainE > 1, "s", "") + " : ta production passera à +" + convertir_texte((etoiles + gainE) * 10) + " %.", 280, 258, #E2E8F0, 13)
appelle centrer("Tes cristaux, machines et améliorations", 280, 290, #FCA5A5, 13)
appelle centrer("repartent à zéro.", 280, 308, #FCA5A5, 13)
appelle bouton(110, 350, 160, 46, "Annuler", #1E293B, #FFFFFF, 15)
appelle bouton(290, 350, 160, 46, "Sauter !", #7C3AED, #FFFFFF, 15)
fin procédure
procédure ecranHyperespace()
rectangle(ecran, 0, 0, 560, 550, #020617)
k est un nombre
avance est un nombre
avance vaut 2 - sautAnim
pour k de 0 à 69
ang est un nombre
ang vaut k * 2.4
d1 est un nombre
d1 vaut 20 + ((ciB[k] * 9 + tic * 18) mod 300)
d2 est un nombre
d2 vaut d1 + 20 + avance * 60
ligne(ecran, 280 + cosinus(ang) * d1, 275 + sinus(ang) * d1, 280 + cosinus(ang) * d2, 275 + sinus(ang) * d2, rgba(165, 243, 252, 0.7), 2)
fin pour
appelle dessinerEtoile(280, 255, 26, #FACC15)
appelle centrer("+" + convertir_texte(etoilesSaut) + " étoile" + sialors(etoilesSaut > 1, "s", ""), 280, 312, #FFFFFF, 26)
fin procédure
procédure dessiner()
effacer(ecran)
contour(ecran, #0)
si etat = 7 alors
appelle ecranHyperespace()
sinon
appelle dessinerGauche()
appelle dessinerBoutique()
si etat = 6 alors
appelle ecranAccueil()
sinon si etat = 5 alors
appelle ecranRetour()
sinon si etat = 4 alors
appelle ecranSaut()
fin si
fin si
fin procédure
@ LES COMMANDES
// actions : 0 clic, 1 M, 2 A
procédure clicPartie(x, y)
si x >= PANNEAU_X alors
si clique(x, y, 300, 10, 118, 32) alors
onglet vaut 0
sinon si clique(x, y, 426, 10, 124, 32) alors
onglet vaut 1
sinon si onglet = 0 et clique(x, y, 360, 478, 184, 28) alors
quantite vaut puissance(10, limiter(arrondi_inferieur((x - 360) / 64), 0, 2))
sinon si y >= 52 et y < 468 alors
rang est un nombre
rang vaut arrondi_inferieur((y - 52) / 52)
si onglet = 0 alors
si machineVisible(rang) alors
appelle acheterMachine(rang)
fin si
sinon si rang < nbDispo alors
appelle acheterAmel(dispoK[rang])
fin si
fin si
sinon
surComete est un booléen
surComete vaut faux
si cometeVie > 0 alors
si hypotenuse(x - cometeX(), y - cometeY()) < 28 alors
surComete vaut vrai
fin si
fin si
si surComete alors
appelle attraperComete()
sinon si hypotenuse(x - AST_X, y - AST_Y) < AST_R * 1.08 alors
appelle cliquerAsteroide(x, y)
sinon si clique(x, y, 20, 470, 250, 36) alors
si etoilesGagnables() >= 1 alors
etat vaut 4
sinon
appelle annoncer("Extrais " + nombreTexte(SEUIL_SAUT) + " cristaux pour sauter !")
fin si
fin si
fin si
fin procédure
procédure lireOrdre(act, x, y)
si etat = 6 alors
si act = 0 et clique(x, y, 190, 396, 180, 50) alors
introVue vaut vrai
etat vaut 1
fin si
sinon si etat = 5 alors
si act = 0 et clique(x, y, 200, 330, 160, 46) alors
etat vaut 1
fin si
sinon si etat = 4 alors
si act = 0 alors
si clique(x, y, 110, 350, 160, 46) alors
etat vaut 1
sinon si clique(x, y, 290, 350, 160, 46) alors
appelle faireSaut()
fin si
fin si
sinon si etat = 1 alors
si act = 1 alors
onglet vaut 0
sinon si act = 2 alors
onglet vaut 1
sinon si act = 0 alors
appelle clicPartie(x, y)
fin si
fin si
fin procédure
@ LE PROCESSUS
processus Mine()
derniereMesure vaut chrono()
tant que appActif
tic vaut tic + 1
nbLus est un nombre
nbLus vaut 0
tant que teteO <> queueO et nbLus < 8
appelle lireOrdre(ordres[teteO], ordX[teteO], ordY[teteO])
teteO vaut (teteO + 1) mod 32
nbLus vaut nbLus + 1
fin tant que
instant est un nombre
instant vaut chrono()
dt est un nombre
dt vaut limiter((instant - derniereMesure) / 1000, 0, 0.5)
derniereMesure vaut instant
si etat = 1 ou etat = 7 alors
appelle avancer(dt)
sauveAttente vaut sauveAttente - dt
si sauveAttente <= 0 alors
appelle sauverPartie()
sauveAttente vaut 15
fin si
fin si
appelle listerAmel()
appelle dessiner()
affiche ecran
pause 60
fin tant que
appelle sauverPartie()
effacer(ecran)
rectangle(ecran, 0, 0, 560, 550, #070B1A)
appelle centrer("Partie sauvegardée : tes machines continuent de miner !", 280, 280, #67E8F9, 16)
affiche ecran
fin processus
@ DEMARRAGE
appelle charger()
appelle listerAmel()
appelle dessiner()
affiche ecran
Mine()
tant que appActif
interagir ecran, ["m", "a", "x"] dans action, sourisX, sourisY
si action = 3 alors
appActif vaut faux
sinon si (queueO + 1) mod 32 <> teteO alors
ordres[queueO] vaut action
ordX[queueO] vaut sourisX
ordY[queueO] vaut sourisY
queueO vaut (queueO + 1) mod 32
fin si
fin tant que