This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix.pde
66 lines (60 loc) · 2.22 KB
/
matrix.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//char[] chars = {'。','「','」','、','・','ヲ','ァ','ィ','ゥ','ェ','ォ','ャ','ュ','ョ','ッ','ー','ア','イ','ウ','エ','オ','カ','キ','ク','ケ','コ','サ','シ','ス','セ','ソ','タ','チ','ツ','テ','ト','ナ','ニ','ヌ','ネ','ノ','ハ','ヒ','フ','ヘ','ホ','マ','ミ','ム','メ','モ','ヤ','ユ','ヨ','ラ','リ','ル','レ','ロ','ワ','ン','゙','゚','7','ァ','ィ','ゥ','ェ','ォ','ャ','ュ','ョ','ッ','ー','ア','イ','ウ','エ','オ','カ','キ','ク','ケ','コ','サ','シ','ス','セ'};
char[] chars = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','a','b','c','d','e','f','g','h','i','j','k','l','0','1','2','3','4','5','6','7','8','9','$','+','-','*','/','=','%','"','\'','#','@','&','_','(',')',',','.',';',':','?','!','\\','<','[',']','`','^'};
char[] humanReadableChars;
PFont font;
PFont humanReadableFont;
int colWidth;
int lineHeight = 25;
int particleTailLength = 35;
int xOffset = 0; // For example 1920: left screen with width of 1920px is left blank
int xMax = 0;
float minSpeed = 0.3;
float maxSpeed = 1.7;
int particleStability = 15;
int particleVitality = 90;
int particleCount = 45;
boolean endOnKey = true;
boolean endOnMouse = true;
Particle[] particles;
boolean checkUpdate = true;
String downloadLink = "";
String downloadKey = "y";
int version = 1;
void setup() {
fullScreen(P2D, SPAN);
noCursor();
textAlign(CENTER, TOP);
font = loadFont("Katakana-96.vlw");
humanReadableFont = loadFont("Calibri-96.vlw");
loadConf();
textFont(font, int(lineHeight*1.85));
colWidth = lineHeight;
//frameRate(10);
particles = new Particle[particleCount];
for(int i = 0; i<particles.length; i++) {
particles[i] = new Particle();
}
if (checkUpdate) {
thread("checkUpdate");
}
}
void draw() {
background(0);
for(int i = 0; i<particles.length; i++) {
particles[i].tick();
}
checkMouse();
}
void checkMouse() {
if (frameCount > 2 && endOnMouse && (pmouseY != mouseY || pmouseX != mouseX)) {
exit();
}
}
void keyPressed() {
if ((key == downloadKey.charAt(0) || key == downloadKey.toUpperCase().charAt(0)) && downloadLink != "") {
link(downloadLink);
}
if (endOnKey) {
exit();
}
}