xxxxxxxxxx
PImage img;
PFont font;
int y = 0;
float h,m,s;
import ddf.minim.*;
Minim minim;
AudioPlayer player;
AudioPlayer beep;
AudioPlayer beat2;
AudioPlayer alarm;
void setup(){
size (1200,700);
frameRate (10);
minim = new Minim(this);
player = minim.loadFile("Latin Industries.mp3");
player.play();
player.loop ();
}
void draw(){
background (0);
display ();
hexagon ();
moreHexagon ();
moreHexagon2 ();
moreHexagon3 ();
arc2 ();
gui();
guiLine();
time();
lineStatic();
mouseClick ();
arcDisplay ();
moreFont();
//Display the Time
fill (#8ED4FF);
font =loadFont ("AndThenItEnds-48.vlw");
textFont (font,22);
text( (int)h + ":" + (int)m + ":" + (int) s,120,50);
text( "Intergalatic Space Station ",450,30);
//text( "Welcome Captain! ",200,30);
img = loadImage("wow gui.png");
image(img, 0, 0);
h= hour();
m= minute ();
s = second ();
}
void display () {
//Show the Circular Clock
fill (42,71,255,40);
noStroke();
rect (10,40,1178,640);
ellipse (270,290,20,20);
ellipse (270,290,100,100);
ellipse (270,290,190,190);
ellipse (270,290,30,30);
ellipse (270,290,40,40);
stroke(#8ED4FF);
rect (300,0, 600,50);
rect (300,650, 600,50);
}
void arc2 (){
strokeWeight (3);
stroke (42,71,255,40);
//lines
line (127,380,54,473);
line (54,473,54,560);
arc (270,290,300,300,PI+ QUARTER_PI, TWO_PI + PI);
ellipse (270,290,20,20);
}
void gui (){
noFill();
stroke (#4BEBFF,40);
strokeWeight (40);
strokeCap (SQUARE);
line( 10,20,1187,20);
line( 10,700,1187,700);
line(-10, 0, -10, 700);
line(1207, 0, 1207, 700); ;
//outer circle
arc (270,290,300,300, PI+ QUARTER_PI, TWO_PI + PI);
}
void lineStatic (){
//show the static line that moves
strokeWeight (1);
stroke (255,255,255,40);
line (16,y,1188,y);
line (12,y,1888,y);
y+= 20;
if (y > height){
y = 0;
}
}
void hexagon () {
fill (42,71,255,40);
noStroke();
pushMatrix();
translate(50, 200);
//rotate(frameCount / -100.0);
polygon(0, 0,25, 6);
polygon(0, 0,30, 6);
popMatrix();
}
void moreHexagon () {
fill (42,71,255,40);
noStroke();
pushMatrix();
translate(50, 260);
polygon(0, 0,25, 6);
polygon(0, 0,30, 6);
popMatrix();
}
void moreHexagon2 () {
fill (42,71,255,40);
noStroke();
pushMatrix();
translate(50, 320);
polygon(0, 0,25, 6);
polygon(0, 0,30, 6);
popMatrix();
}
void moreHexagon3 () {
fill (42,71,255,40);
noStroke();
pushMatrix();
translate(50, 380);
polygon(0, 0,25, 6);
polygon(0, 0,30, 6);
popMatrix();
stroke(#6AC7FF);
}
void polygon(float x, float y, float radius, int npoints) {
float angle = TWO_PI / npoints;
beginShape();
for (float a = 0; a < TWO_PI; a += angle) {
float sx = x + cos(a) * radius;
float sy = y + sin(a) * radius;
vertex(sx, sy);
}
endShape(CLOSE);
}
int yr = year();
int d= day ();
int mth = month ();
void moreFont () {
fill (#7ED5FF);
font =loadFont ("AtmosphereLight-48.vlw");
textFont (font,20);
text( (int)mth + "/" + (int)d + "/" + (int)yr,200,500);
String [] phrases = {"Breach on lower deck!", "Captain is a grade A Cutie!", "ALERT ALERT TIMELORD SPOTTED!!!", "Clone has come out of statis.", "My patience with you will expire.", " Frak!", "Riot in hallway 3!", "Air pressure is stable", "WARNING CHERUB breeding season", "Approaching earth"," Cap is in cryostatis", "Current temperature is 70 degrees", "Infinity and beyond!","Please stop pretending to be Sheperd", "So say we all!", "Titans in space!", "Captain have you jaunted lately?", "Unqualified to be a guardian of the galaxy.", "Captain is too old to pilot a mecha!", "Mecha mom spotted!", "Spotted angel on the moon.","Looks like end of Eva is happening!"
};
int p = int (random(22));
textFont (font,16);
text( phrases[p],545,450);
}
void mouseClick () {
if (mousePressed){
minim = new Minim(this);
beep = minim.loadFile("cgeffex__sci-fi-beep-01.wav");
beep.play();
player.close();
beat2 = minim.loadFile("233985__foolboymedia__running-out.mp3");
beat2.play();
}
}
float x1 = 1;
float x2 = 1;
float x3 =3;
float x4= 7;
float x5= 2;
float speed;
int savedTime;
int totalTime;
int savingTime;
void time() {
//Should actually alert every hour, but to make code work in class, runs every minute.
//To work each hour, change total time to 3600000
//To make it alert every five seconds use 5000
totalTime = 60000;
int passedTime = millis() - savedTime;
if (passedTime > totalTime) {
println( "1 minute has passed " );
fill (0);
background(#FC001E,90);
font =loadFont ("AtmosphereLight-48.vlw");
textFont (font,200);
//text( (int)h + ":" + (int)m + ":" + (int) s,120,50);
text( "EMERGENCY ",10,400);
minim = new Minim(this);
alarm = minim.loadFile("25032__sirplus__extreme-alarm.wav");
alarm.play();
savedTime = millis(); // Save the current time to restart the timer!
}
}
void arcDisplay (){
noFill();
stroke (#4BEBFF,40);
strokeWeight (10);
strokeCap (SQUARE);
arc (270,290,300,300, -PI/10,speed);
rect (800,326,10, -x1);
rect (600,326,10, -x3);
rect (700,326,10, -x4);
rect (900,326,10, -x5);
if (x1 > 0) {
//Grow the arc and lines
x1 += 1.7;
x2 += 0.5;
x3 = random (1,200);
x4 = random (30,200);
x5= random (7,200);
speed = 0.05 * x2;
if (x1>=200){
x1= 10;
x2 =10;
}
}
}
void guiLine (){
stroke (#4BFFF4,90);
strokeWeight (5);
strokeCap (SQUARE);
line(1160, 70, 1160, 540);
line(1125, 70, 1125, 540);
line(1090, 70, 1090, 540);
line (800,360, 1050, 360);
stroke (#4BFFF4);
strokeWeight (2);
fill (#8ED4FF,40);
rect (460,390,590,145,90,18,18,18);
rect (460,100,590,230,90,18,18,18);
}