Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PFont myFont;
- String myText = "F I C K L E";
- int rad = 500; // Width of the shape
- float xpos, ypos; // Starting position of shape
- float xspeed =50; // Speed of the shape
- float yspeed = -20; // Speed of the shape
- int xdirection = 50; // Left or Right
- int ydirection = -50; // Top to Bottom
- void setup(){
- size(960,540);
- noStroke();
- myFont = createFont("garamond", 60);
- textFont(myFont);
- textAlign(CENTER, CENTER);
- frameRate(2);
- ellipseMode(CENTER);
- fill(250,150,120,190);
- xpos = width/2;
- ypos = height/2;
- myFont = createFont("garamond", 60);
- textFont(myFont);
- textAlign(CENTER, CENTER);
- }
- void draw(){
- background(102);
- fill(random(250),random(255),random(250),255);
- rect(0,0,width,height);
- fill(0,255);
- text(myText, width/2, height/2);
- for (int y = 0; y < 100; y++){
- for (int i = 0; i < 500; i++){
- ellipse(i*8,y*8,5,5);
- fill(100,100,100,100);
- }
- }
- xpos = xpos + ( xspeed * xdirection );
- ypos = ypos + ( yspeed * ydirection );
- if (xpos > width-rad || xpos < rad) {
- xdirection *= -1;
- }
- if (ypos > height-rad || ypos < rad) {
- ydirection *= -1;
- }
- // Draw the shape
- ellipse(xpos, ypos, rad, rad);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement