Press the reset button to play again! Generator works one at a time!
A fork of My Sketch by Tiana Templeton
xxxxxxxxxx
//GLOBAL VARIABLE SPACE -----------------------------
let angelNumber = [];
let divineFont;
let startButton;
let firstY = 30;
let secondY = 560;
let thirdY = 300;
let fourthY = 560;
let fifthY = 30;
let sixthY = 300;
let seventhY = 30;
let eighthY = 560;
let ninthY = 300;
//PRELOAD FUNCTIONS ---------------------------------
function preload() {
//Font --------------------------------------
divineFont = loadFont('AntiqueQuestSt.ttf');
//Arrays -----------------------------------
angelNumber = ["1 1 1 ", '2 2 2 ', '3 3 3 ', '4 4 4 ', '5 5 5 ', '6 6 6 ', '7 7 7 ', '8 8 8 ', '9 9 9 '];
}
//MAIN FUNCTIONS ------------------------------------
function setup() {
createCanvas(500, 450);
//Shadowing ---------------------------------
drawingContext.shadowOffsetX = 5;
drawingContext.shadowOffsetY = -5;
drawingContext.shadowBlur =10;
drawingContext.shadowColor = 'white';
//Start Button ------------------------------
startButton = createButton('Guide Me!');
startButton.position(600, 515);
startButton.mousePressed(displayMessage);
}
function draw() {
background(89, 34, 112);
//Moving Background -------------------------
firstBack();
secondBack();
thirdBack();
fourthBack();
fifthBack();
sixthBack();
seventhBack();
eighthBack();
ninthBack();
//Slot Machine ------------------------------
drawMachine();
//Link to website ---------------------------
let a = createA('https://www.theangelwriter.com/blog/guide-angel-numbers', 'Learn more about angel numbers.');
a.position(527, 335);
}
//INTERACTIVE FUNCTIONS -----------------------------
//CUSTOM FUNCTIONS ----------------------------------
function drawMachine(){
fill(173, 6, 0);
noStroke();
rect(95, 165, 300, 170);
rect(122, 80, 250, 85);
fill(63, 3, 0);
rect(148, 100, 200, 50);
fill('black')
rect(122, 180, 250, 140);
fill(255, 215, 0);
rect(135, 200, 220, 100);
push();
fill('white');
stroke(6);
for (var x = 0; x < 180; x+=60) {
square(x+155, 220, 60);}
pop();
push();
for(var x = 0; x<245; x+=17){
circle(x+129, 90, 7);}
pop();
push();
for(var y=0; y<60; y+=17){
circle(129, y+105, 7);
circle(366, y+105, 7);}
pop();
push();
color('yellow');
for(var x=0; x<300; x+=17){
circle(x+100, 327, 7);}
pop();
push();
fill('yellow');
for(var x=0; x<270; x+=17){
circle(x+117, 172, 7);}
pop();
push();
fill('yellow');
for(var y=0; y<150; y+=17){
circle(100, y+173, 7);
circle(389, y+173, 7);}
pop();
fill('white');
textSize(19);
textFont(divineFont)
text('DIVINE GUIDANCE', 156, 132);
}
function displayMessage(){
redraw();
fill('grey');
frameRate(0);
textSize(50);
textFont('AntiqueQuestSt.ttf');
let guidance = random(angelNumber);
text(guidance, 175, 267);
}
function firstBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('1', -40, firstY);
firstY++
if(firstY > 800){
firstY = 0;
}
pop();
}
function secondBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('2', 160, secondY);
secondY++
if(secondY > 800){
secondY = 0;
}
pop();
}
function thirdBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('3', 160, thirdY);
thirdY++
if(thirdY > 800){
thirdY = 0;
}
pop();
}
function fourthBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('4', 350, fourthY);
fourthY++
if(fourthY > 800){
fourthY = 0;
}
pop();
}
function fifthBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('5', 160, fifthY);
fifthY++
if(fifthY > 800){
fifthY = 0;
}
pop();
}
function sixthBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('6', 350, sixthY);
sixthY++
if(sixthY > 800){
sixthY = 0;
}
pop();
}
function seventhBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('7', 350, seventhY);
seventhY++
if(seventhY > 800){
seventhY = 0;
}
pop();
}
function eighthBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('8', -10, eighthY);
eighthY++
if(eighthY > 800){
eighthY = 0;
}
pop();
}
function ninthBack(){
push();
fill('white');
textSize(300);
textFont('AntiqueQuestSt.ttf');
text('9', -20, ninthY);
ninthY++
if(ninthY > 800){
ninthY = 0;
}
pop();
}