Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1013744 // Heart Beat, 2x Bigger [OK on Windows & Linux]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 994K of libraries. Click here for Pure Java version (1882L/12K).

!7

p { pMain(HeartBeat); }

public sclass HeartBeat extends PApplet {
  public void settings() { size(1200, 400); }
  
  int x = 0;
  float py = 0;
  float scale = 2;
 
  public void setup() {
    background(0);
  }
 
  public void draw() {
    noStroke();
    fill(0,0,0,15);
    rect(0,0,width,height);
    translate(0,height/2);
    scale(scale);
    x++;
    x%=width/scale;
    float fx = py + random(-20,20);
    stroke(100,255,100);
    noFill();
    line(x-1,py, x,fx);
    py = minmax(fx, -height/2/scale, height/2/scale);
  }
}

Author comment

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: 537 / 1356
Version history: 3 change(s)
Referenced in: