Du genre, on définit l'existence d'une vingtaine de rooms, et when play begins, on les répartir les unes envers les autres, de manière totalement aléatoire ?
ça me servirait bien, ça aussi

Modérateurs: Stormi, Otto Grimwald
[Définit une kind of room particulière : le labyrinthe]
A maze is a kind of room. The description of a maze is usually "Je me suis perdu dans ce labyrinthe. Les directions possibles sont : [exits]"
Couloir jaune, Couloir rouge, Couloir vert, Couloir bleu, Couloir blanc, Couloir noir, Couloir orange, Couloir violet, Couloir rose, and Couloir gris are mazes.
[Définit l'entrée et la sortie]
Entrée is a room. "Le labyrinthe commence ici. Les directions possibles sont : [exits]". The player is in entrée.
Arrivée is a room. "Oui ! J'ai réussi !".
The trésor is a thing in Arrivée. The description is "Le prendre me ferait gagner la partie.". After taking the trésor, end the story saying "Vous avez gagné !".
[permet de lister les sorties possibles]
To say exits:
repeat with D running through directions:
if the room D from the location is a room, say "[line break]• [D] ;".
[Au début du jeu, arrange les pièces dans un ordre aléatoires]
When play begins:
repeat with R1 running through mazes:
let R2 be a random maze that is not R1;
let D1 be a random direction;
let D2 be the opposite of D1;
change the D1 exit of R1 to R2;
change the D2 exit of R2 to R1;
let R be a random maze;
let D1 be a random direction;
let D2 be the opposite of D1;
change the D1 exit of Arrivée to R;
change the D2 exit of R to Arrivée;
let R be a random maze;
let D1 be a random direction;
let D2 be the opposite of D1;
change the D1 exit of Entrée to R;
change the D2 exit of R to Entrée.
A direction can be flat. A direction is usually flat. Outside is not flat. Inside is not flat. Up is not flat. Down is not flat.
[…]
let D be a random flat direction;
[…]
The Plaine is a room.
A biome is a kind of room.
Marais, Forêt décidue tempérée, Forêt tropicale humide, Toundra, Taïga, Savane, Désert and Chaparral are biomes.
Before going a direction (called D) when a biome is not visited:
let destination be the room D from the location;
if destination is a room, continue the action;
let B be a random biome that is not visited;
change the D exit of the location to B;
let D2 be the opposite of D;
change the D2 exit of B to the location.
Une grille comme ça
abcde
1 OOOOO
2 OOOOO
3 OOOOO
Où chaque lieu est relié aux autres par toutes les directions, et où, au début du jeu, on met un endroit au hasard dans chaque coordonnées.
"map" by Pieyre Wittmann
Include French by Eric Forgeot.
Use French Language.
Include Basic Screen Effects by Emily Short.
Include boussole by Benjamin Roux.
A maproom is a kind of room.
A room can be plaine, forêt, marais or désert. A room is usually plaine.
Before printing the locale description when player is in a plaine room, say "[line break]Vous êtes dans une plaine.".
Before printing the locale description when player is in a forêt room, say "[line break]Vous êtes dans une forêt.".
Before printing the locale description when player is in a marais room, say "[line break]Vous êtes dans des marais.".
Before printing the locale description when player is in a désert room, say "[line break]Vous êtes dans un désert.".
After printing the locale description when player is in a maproom, say "[line break]Il est : [bold type][time of day][roman type]. Les directions possibles sont :[line break][exits]".
A room can be faite. A room is usually not faite.
A direction can be flat. A direction is usually flat. Outside is not flat. Inside is not flat. Up is not flat. Down is not flat.
Before going somewhere :
clear the screen.
Before going somewhere when player is in a plaine room:
repeat with x running from 1 to a random number between 5 and 15
begin;
follow the turn sequence rules;
end repeat.
Before going somewhere when player is in a forêt room:
repeat with x running from 1 to a random number between 15 and 45
begin;
follow the turn sequence rules;
end repeat.
Before going somewhere when player is in a marais room:
repeat with x running from 1 to a random number between 45 and 120
begin;
follow the turn sequence rules;
end repeat.
Room1 is a maproom.
Room2 is a maproom.
Room3 is a maproom.
Room4 is a maproom.
Room5 is a maproom.
Room6 is a maproom.
Room7 is a maproom.
Room8 is a maproom.
Room9 is a maproom.
Room10 is a maproom.
Room11 is a maproom.
Room12 is a maproom.
Room13 is a maproom.
Room14 is a maproom.
Room15 is a maproom.
Room16 is a maproom.
Room17 is a maproom.
Room18 is a maproom.
Room19 is a maproom.
Room20 is a maproom.
To say exits:
repeat with D running through directions:
if the room D from the location is a room, say "[line break]• [D][line break]".
An arbre is a kind of thing.
A sapin is a kind of arbre. There are 100 sapin.
A chêne is a kind of arbre. There are 100 chêne.
A hêtre is a kind of arbre. There are 100 hêtre.
When play begins:
[ ROOM 1 ---> R ]
let R be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of Room1 to R;
change the D2 exit of R to Room1;
now Room1 is faite;
now R is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R is désert;
end if;
[ R ---> R2 ]
let R2 be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of R to R2;
change the D2 exit of R2 to R;
now R2 is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R2 is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R2;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R2 is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R2 is désert;
end if;
[ R ---> R3 ]
let R3 be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of R to R3;
change the D2 exit of R3 to R;
now R3 is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R3 is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R3;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R3 is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R3 is désert;
end if;
[ R2 ---> R4 ]
let R4 be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of R2 to R4;
change the D2 exit of R4 to R2;
now R4 is faite;
[ TYPE DE ROOM ]
if a random chance of 1 in 5 succeeds
begin;
now R4 is forêt;
let ARB be a random number between 5 and 15;
repeat with x running from 1 to ARB
begin;
move a random arbre to R4;
end repeat;
otherwise if a random chance of 1 in 15 succeeds;
now R4 is marais;
otherwise if a random chance of 1 in 50 succeeds;
now R4 is désert;
end if.
Player is in Room1
[ R2 ---> R5 ]
let R5 be a random not faite maproom which is not Room1;
let D1 be a random flat direction;
let D2 be the opposite of D1;
change the D1 exit of R2 to R5;
change the D2 exit of R5 to R2;
now R5 is faite;
Retourner vers Questions techniques et aide pour votre code
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 2 invités