Last active
December 16, 2018 00:30
-
-
Save wonderburg7/8c324af3d00944dd96100aa936868742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PImage img1, img2, img3; | |
float x1, x2, y1, y2; | |
float angle1 = 0, angle2 = 15; | |
float scalar = 15; | |
int flapvalue = 1; | |
int bee = 1; | |
void setup() { | |
size(200, 120); | |
imageMode(CENTER); | |
if (bee == 1){ | |
img1 = loadImage("https://i.imgur.com/YBay2zz.png"); // cute bee | |
img2 = loadImage("https://i.imgur.com/pRyskin.png"); | |
img3 = loadImage("https://i.imgur.com/CWLDnEP.png"); | |
} else if (bee == 2) { //left bee | |
img1 = loadImage("https://i.imgur.com/tOpZTc0.png"); | |
img2 = loadImage("https://i.imgur.com/oBsukMG.png"); | |
img3 = loadImage("https://i.imgur.com/U8xza4K.png"); | |
} else if (bee == 3) { // black eyed bee | |
img1 = loadImage("https://i.imgur.com/0TEivpz.png"); | |
img2 = loadImage("https://i.imgur.com/yUMwfKV.png"); | |
img3 = loadImage("https://i.imgur.com/blxT5qq.png"); | |
} else if (bee == 4) { // right bee | |
img1 = loadImage("https://i.imgur.com/e5Xt1jS.png"); | |
img2 = loadImage("https://i.imgur.com/mILtHQo.png"); | |
img3 = loadImage("https://i.imgur.com/4B6k7jt.png"); | |
} | |
} | |
void draw() { | |
float ang1 = radians(angle1); | |
y1 = height/2 + (scalar * sin(ang1)); | |
pushMatrix(); | |
translate(0, y1-height/2-35); | |
background(0, 0); | |
// drawAtomBG(); | |
float time = (float)millis()/350; | |
//ellipse(width/2, width/2, 25, 25); | |
if (flapvalue == 1) { | |
image(img1, width/2, width/2, 150, 150); | |
} else if (flapvalue == 2) { | |
image(img2, width/2, width/2, 150, 150); | |
} else if (flapvalue == 3) { | |
image(img3, width/2, width/2, 150, 150); | |
} | |
flapvalue++; | |
if (flapvalue == 4) { | |
flapvalue = 1; | |
} | |
popMatrix(); | |
angle1 += 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment