xxxxxxxxxx
253
var TITRE_FIN
// variable PERSONNAGE
var PERSO = ["John McClane", "sa femme Holly", "M. Takagi", "ses employés", "un commando", "le Titanic", "un iceberg", "un artiste", "une grande bourgeoise", "L'Empire galactique", "Lando Calrissian", "Han Solo", "Jabba Le Hutt", "le chasseur de primes Boba Fett", "la princesse Leia", "Luke Skywalker", "Chewbacca", "C-3PO", "Dark Vador", "ses compagnons", "Peter", "Raymond", "Egon", "le Doyen de la faculté", "les revenants", "L'actrice Chris McNeil", "sa fillette Regan", "la petite", "Une force para-normale", "Chris", "deux exorcistes", "un Terminator", "Sarah Connor", "Kyle Reese", "le robot", " la jeune femme", "Travis Bickle", "une prostituée mineure", "ses souteneurs", "Fernand Naudin", "Louis", "le Mexicain", "sa fille Patricia"
];
// variable ADJECTIF
var ADJ = ["secret", "grand", "moderne", "pauvre", "puissant", "ignoble", "extrême", "obscur", "curieux", "jeune", "humain", "nocturnes", "tranquille", "dernier", "louches"];
// variable LIEU
var LIEU = ["une multinationale japonaise", "la Nakatomi Corporation", "l’immeuble", "l’extérieur", "Southampton", "Le paquebot", "la nouvelle arme", "l'Etoile de la Mort", "leurs amis", " la lune forestière d'Endor", " le générateur du bouclier", "l'Alliance rebelle", "S.O.S. Fantômes", "sa chambre", "Los Angeles", "Vietnam", "New York", "une petite usine de tracteurs", "Paris"];
// variable POLICES
var courier
var compteur = 0
var ColorVar = 0
var PosText = 300
var NumVar = 0
var TitreNumVar = " "
var ENTER_1 = ("Apuyer sur ''ENTRER'' pour générer un scénario !")
var ENTER_2 = ("Apuyer sur ''ENTRER'' pour générer un nouveau scénario !")
function preload(){
courier = loadFont("Courier Prime.ttf");
BebasNeue = loadFont("BebasNeue-Regular.ttf");
}
function setup() {
createCanvas(700, 600);
background(0);
fill(255);
rect(50,50,600,500);
if ( compteur < 130 ){
ColorVar = ColorVar + 2 ;
} else {
ColorVar = ColorVar - 2;
}
if ( compteur == 260 ){
compteur = 0 ;
}
}
// permet de varier la couleur du texte d'introduction
function draw() {
compteur ++;
if ( compteur < 70 ){
ColorVar = ColorVar + 4 ;
NumVar = 0 ;
} else {
ColorVar = ColorVar - 4;
NumVar = 1 ;
}
if ( compteur == 140 ){
compteur = 0 ;
}
if (NumVar == 1){
TitreNumVar = int (random(2,5));
} else {
TitreNumVar = " ";
}
textAlign(CENTER, CENTER);
fill (ColorVar);
textSize(30);
textFont(BebasNeue)
text (ENTER_1, 350, PosText );
}
// commande au clic
function keyPressed(){
if (keyCode === ENTER){
PosText = 570;
ENTER_1 = ENTER_2;
fill(255);
text( "appuyer sur '' S '' pour sauvgarder",500, 25);
// remplir le fond avec un fond blanc un peu transparent
fill(255);
rect(50,50,600,500);
//aller chercher une valeur aléatoire dans chacun des tableaux
var rand_PERSO = int(random(PERSO.length));
var rand_ADJ = int(random(ADJ.length));
var rand_LIEU = int(random(LIEU.length));
// VARIABLE TITRE
var TITRE_1 = ["EXORCISTE", "LES TONTONS", "TERMINATOR", "LE PIEGE DE", "TITANIC", "GOST", "TAXI",
"LE RETOUR DU"];
var TITRE_2 = ["EXORCISTE", "FLINGUEURS", "TERMINATOR", "CRISTAL", "TITANIC", "BUSTER", "DRIVER", "JEDI"];
// DIE HARD
var D_H_1 = [PERSO[rand_PERSO] + ", un policier new-yorkais, est venu rejoindre" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", dont il est séparé depuis plusieurs mois, pour les fêtes de Noël dans le"+ " " + ADJ[ rand_ADJ] + " " + "espoir d'une réconciliation." ];
var D_H_2 = ["Celle-ci est cadre dans" + " " + LIEU[rand_LIEU] + " " + "," + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] +"." ];
var D_H_3 = ["Son patron," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", donne une soirée en l'honneur de" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", à laquelle assiste" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "." ];
var D_H_4 = ["Tandis qu'il s'isole pour téléphoner," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "investit" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + " " + "et coupe toutes les communications avec" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "…"];
// TITANIC
var T_1 = [LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + ", 10 avril 1912." ];
var T_2 = [LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + " " + "le plus" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "et le plus" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "du monde, réputé pour son insubmersibilité," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", appareille pour son premier voyage." ];
var T_3 = ["Quatre jours plus tard, il heurte" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "." ];
var T_4 = ["A son bord," + " "+ PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "et" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "tombent amoureux."];
// STAR WARS
var S_W_1 = [PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "est plus" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "que jamais : la construction de" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "," + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + ", menace l'univers tout entier..."];
var S_W_2 = ["Arrêté après la trahison de" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "est remis à l'" + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "contrebandier" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "par" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "." ];
var S_W_3 = ["Après l'échec d'une première tentative d'évasion menée par" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", également arrêtée par" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "et" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "parviennent à libérer" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "."];
var S_W_4 = [PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "et" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + "devenu un Jedi, s'envolent dès lors pour une mission d'" + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "importance sur" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "," + " " + "afin de détruire" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + " " + "de" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + " " + "et permettre une attaque des pilotes de" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "." ];
var S_W_5 = ["Conscient d'être un danger pour" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ","+ " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "préfère se rendre aux mains de" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + "son père et ancien Jedi passé du côté" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "de la Force."];
// Gost Buster
var G_B_1 = [PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "et" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "effectuent des recherches sur la parapsychologie."];
var G_B_2 = ["Virés par" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "," + " " + "ils décident de fonder une société destinée à chasser" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "."];
var G_B_3 = ["Son nom :" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "."];
var G_B_4 = ["Le succès frappe tant et si bien à leur porte qu'ils en sont bientôt à travailler à la chaîne."];
// EXORCISTE
var E_1 = [PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "est inquiète au sujet de" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + ":" + " " + "après que l'on ait entendu des bruits" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "venant de" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "a changé, proférant de constantes insanités."];
var E_2 = [PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "l'habite, qui coûte la vie au metteur en scène de" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "."];
var E_3 = ["Désespérée, cette dernière fait appel à" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "..."];
// TERMINATOR
var TER_1 = [ "A" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + " " + "en 1984," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", cyborg surgi du futur, a pour mission d'exécuter"+ " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", une" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "femme dont l'enfant à naître doit sauver l'humanité."];
var TER_2 = [PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", un résistant" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + ", débarque lui aussi pour combattre" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + ", et aider" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] +"..."];
// Taxi driver
var T_D_1 = [ "Vétéran de la Guerre du" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))]+ "," + " "+ PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "est chauffeur de taxi dans la ville de" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "."];
var T_D_2 = ["Ses rencontres" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "et la violence quotidienne dont il est témoin lui font peu à peu perdre la tête."];
var T_D_3 = ["Il se charge bientôt de délivrer" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "de" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "."];
// LES TONTONS FLINGUEURS
var T_F_1 = ["Propriétaire d'" + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "mène une vie" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "et sans histoire quand un télégramme l'appelle à" + " " + LIEU[rand_LIEU + int(random(LIEU.length - rand_LIEU))] + "."];
var T_F_2 = ["Il arrive à temps pour recueillir le" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "soupir d'un ami de jeunesse," + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "dit «" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + " " + "», qui lui confie ses affaires" + " " + ADJ[ rand_ADJ + int(random(ADJ.length - rand_ADJ))] + " " + "en même temps que la garde de" + " " + PERSO[rand_PERSO + int(random(PERSO.length - rand_PERSO))] + "."];
var T_F_3 = ["Et les ennuis commencent..."];
// TOUTE LES PHRASES
var PHRASE = [D_H_1, D_H_2, D_H_3, D_H_4, T_1, T_2, T_3, T_4, S_W_1, S_W_2, S_W_3, S_W_4, S_W_5, G_B_1, G_B_2, G_B_3, G_B_4, E_1, E_2, E_3, TER_1, TER_2, T_D_1, T_D_2, T_D_3, T_F_1, T_F_2, T_F_3];
var rand_Phrase = int(random(PHRASE.length));
var rand_Phrase2 = int(random(PHRASE.length));
var rand_Phrase3 = int(random(PHRASE.length));
var TEXT = PHRASE[rand_Phrase];
var TEXT2 = PHRASE[rand_Phrase2];
var TEXT3 = PHRASE[rand_Phrase3];
var TITRE_3 = TITRE_1[int(random(TITRE_1.length))] + " " + TITRE_2[int(random(TITRE_2.length))] + " " + TitreNumVar
TITRE_FIN = TITRE_3;
// afficher les textes
textAlign(LEFT, TOP);
fill(0)
textSize(16);
textFont(courier)
// Scénario phrase 1
text(TEXT, 100, 150, 500, 200);
// Scénario phrase 2
text(TEXT2, 100, 285, 500, 200);
// Scénario phrase 3
text(TEXT3, 100, 410, 500, 200);
// Titre du film
text("Titre : " + TITRE_3, 100, 100)
}
}
// fonction qui s'exécute quand une touche est relâché
function keyReleased() {
// appuyer sur "s" permet d'enregistrer l'image
if (key == 's' || key == 'S') {
saveCanvas(year()+ "/"+month()+ "/"+day()+'-'+hour()+"/"+ minute()+"/" + second()+ "-" + TITRE_FIN + '.jpg');
}
}