Download Jar. Uses 994K of libraries. Click here for Pure Java version (1882L/12K).
1 | !7 |
2 | |
3 | p { pMain(HeartBeat); }
|
4 | |
5 | public sclass HeartBeat extends PApplet {
|
6 | public void settings() { size(1200, 400); }
|
7 | |
8 | int x = 0; |
9 | float py = 0; |
10 | float scale = 2; |
11 | |
12 | public void setup() {
|
13 | background(0); |
14 | } |
15 | |
16 | public void draw() {
|
17 | noStroke(); |
18 | fill(0,0,0,15); |
19 | rect(0,0,width,height); |
20 | translate(0,height/2); |
21 | scale(scale); |
22 | x++; |
23 | x%=width/scale; |
24 | float fx = py + random(-20,20); |
25 | stroke(100,255,100); |
26 | noFill(); |
27 | line(x-1,py, x,fx); |
28 | py = minmax(fx, -height/2/scale, height/2/scale); |
29 | } |
30 | } |
Began life as a copy of #1013742
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, jmyaexzvplwz, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1013744 |
| Snippet name: | Heart Beat, 2x Bigger [OK on Windows & Linux] |
| Eternal ID of this version: | #1013744/4 |
| Text MD5: | afc3c6f361e26632d5ce59de92254897 |
| Transpilation MD5: | 31eba5f46ef1e0f54b580fb92473140e |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX source code (desktop) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-02-12 17:15:03 |
| Source code size: | 567 bytes / 30 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 835 / 2068 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |