Skip to content

Commit c39edbf

Browse files
author
jowong1
committed
Added Bicyclist
1 parent 72c0cc5 commit c39edbf

1 file changed

Lines changed: 370 additions & 0 deletions

File tree

OriginalDesign.pde

Lines changed: 370 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ int wing = -1;
88
int wingTwo = -1;
99
int wingY = 151;
1010
int wingYtwo = 151;
11+
12+
//FOR BIKER
13+
int q = 0;
14+
int back = 190;
15+
int backShift = -1;
16+
int r =(int)(Math.random()*256);
17+
int g =(int)(Math.random()*256);
18+
int b =(int)(Math.random()*256);
19+
int rightY = 470;
20+
int move = -1;
21+
float spin = 0.0;
22+
//
1123
void setup()
1224
{
1325
size(800,600);
@@ -23,9 +35,68 @@ void draw()
2335
trees();
2436
clouds();
2537
bird();
38+
39+
////////////FOR BIKER ///////////////
40+
pushMatrix();
41+
//translate(width*0.2, height*0.5);
42+
translate(q + 70,520);
43+
//rotate(frameCount/5.0);
44+
rotate(spin);
45+
//polygon(0, 0, 50, 4); // Triangle
46+
fill(0,0,0,75);
47+
rect(0,0,2,50);
48+
rect(0,0,50,2);
49+
rect(0,0,-50,2);
50+
rect(0,0,2,-50);
51+
//rect(0,0,5,100);
52+
popMatrix();
53+
// V cleaner V
54+
pushMatrix();
55+
translate(q + 260,520);
56+
rotate(spin);
57+
rect(0,0,2,50);
58+
rect(0,0,50,2);
59+
rect(0,0,-50,2);
60+
rect(0,0,2,-50);
61+
popMatrix();
62+
spin = spin + 1.0;
63+
///
64+
biker();
65+
//text("back: "+back, 200,200);
66+
//text("q: "+q, 200,220);
67+
//text("back + q: "+(back+q), 200, 240);
68+
//text("q+170: "+(q+170), 200,260);
69+
//text("q+190: "+(q+190), 200, 280);
70+
q = q - 3;
71+
if(q < -400){
72+
q = 2000;
73+
r =(int)(Math.random()*256);
74+
g =(int)(Math.random()*256);
75+
b =(int)(Math.random()*256);
76+
back = 190;
77+
}
78+
79+
if(back < 170){
80+
backShift = 1;
81+
}else if(back > 190){
82+
backShift = -1;
83+
}
84+
back = back + backShift;
85+
rightY = rightY + move;
86+
if(rightY < 450){
87+
move = 1;
88+
}
89+
if(rightY > 470){
90+
move = -1;
91+
}
2692

93+
/////////// END BIKER ////////////////
94+
95+
2796
window();
2897
filler();
98+
fill(119,133,155);
99+
rect(50,550,750, 50);
29100

30101

31102
wingY = wingY + wing;
@@ -156,3 +227,302 @@ void bird(){
156227
quad(wingX+300,wingY, wingX+302,wingY-2, wingX+319,170, wingX+315,170);
157228
quad(wingX+344,wingYtwo-10, wingX+346,wingYtwo+2-10, wingX+321,170, wingX+316,170);
158229
}
230+
231+
232+
233+
234+
235+
236+
237+
238+
239+
240+
241+
242+
243+
244+
245+
246+
247+
248+
249+
//void setup()
250+
//{
251+
// size(800,600);
252+
// frameRate(80);
253+
//}
254+
//void draw()
255+
//{
256+
// background(119,133,155);
257+
// ///
258+
// // recta();
259+
// pushMatrix();
260+
// //translate(width*0.2, height*0.5);
261+
// translate(q + 70,520);
262+
// //rotate(frameCount/5.0);
263+
// rotate(spin);
264+
// //polygon(0, 0, 50, 4); // Triangle
265+
// fill(0,0,0,75);
266+
// rect(0,0,2,50);
267+
// rect(0,0,50,2);
268+
// rect(0,0,-50,2);
269+
// rect(0,0,2,-50);
270+
// //rect(0,0,5,100);
271+
// popMatrix();
272+
// // V cleaner V
273+
// pushMatrix();
274+
// translate(q + 260,520);
275+
// rotate(spin);
276+
// rect(0,0,2,50);
277+
// rect(0,0,50,2);
278+
// rect(0,0,-50,2);
279+
// rect(0,0,2,-50);
280+
// popMatrix();
281+
// spin = spin + 1.0;
282+
// ///
283+
// biker();
284+
// text("back: "+back, 200,200);
285+
// text("q: "+q, 200,220);
286+
// text("back + q: "+(back+q), 200, 240);
287+
// text("q+170: "+(q+170), 200,260);
288+
// text("q+190: "+(q+190), 200, 280);
289+
// q = q - 5;
290+
// if(q < -200){
291+
// q = 800;
292+
// r =(int)(Math.random()*256);
293+
// g =(int)(Math.random()*256);
294+
// b =(int)(Math.random()*256);
295+
// back = 190;
296+
// }
297+
298+
// if(back < 170){
299+
// backShift = 1;
300+
// }else if(back > 190){
301+
// backShift = -1;
302+
// }
303+
// back = back + backShift;
304+
// rightY = rightY + move;
305+
// if(rightY < 450){
306+
// move = 1;
307+
// }
308+
// if(rightY > 470){
309+
// move = -1;
310+
// }
311+
//}
312+
313+
void biker(){
314+
//Constant objects
315+
bike();
316+
//Not Constant
317+
movingLeg();
318+
//Constant objects
319+
shoe();
320+
torso();
321+
hands();
322+
head();
323+
}
324+
void movingLeg(){
325+
noStroke();
326+
//text(r+","+g+","+b,100,100);
327+
fill(r,g,b);
328+
quad(q+140,440,q+200,rightY,q+180,rightY+10,q+120,460);//445
329+
quad(q+180,rightY,q+200,rightY,q+back,rightY+50,q+back-20,rightY+50);
330+
}
331+
332+
void shoe(){
333+
fill(0,0,0);
334+
beginShape();
335+
vertex(q-21+back,rightY+50);
336+
vertex(q+7+back,rightY+50);
337+
vertex(q+12+back,rightY+51);
338+
vertex(q+17+back,rightY+55);
339+
vertex(q+19+back,rightY+60);
340+
vertex(q+18+back,rightY+65);
341+
vertex(q+1.5-23+back,rightY+65);
342+
vertex(q-23+back,rightY+60);
343+
vertex(q-23+back,rightY+52);
344+
endShape(CLOSE);
345+
}
346+
void bike(){
347+
//Petal
348+
fill(111, 118, 130);
349+
beginShape();
350+
vertex(q-15+back,rightY+65);
351+
vertex(q+10+back,rightY+65);
352+
vertex(q+10+back,rightY+75);
353+
vertex(q-15+back,rightY+75);
354+
endShape(CLOSE);
355+
fill(0, 0, 0);
356+
ellipse(q-3.5+back,rightY+70,5,4.75);
357+
fill(86, 89, 94);
358+
ellipse(q-2.5+back,rightY+70,5,5);
359+
360+
//Wheels
361+
//Front Wheel
362+
stroke(10);
363+
noFill();
364+
ellipse(q+260,520,100,100);
365+
ellipse(q+260,520,99,99);
366+
ellipse(q+260,520,98,98);
367+
ellipse(q+260,520,97,97);
368+
//Back Wheel
369+
ellipse(q+70,520,100,100);
370+
ellipse(q+70,520,99,99);
371+
ellipse(q+70,520,98,98);
372+
ellipse(q+70,520,97,97);
373+
noStroke();
374+
fill(76, 75, 75);
375+
ellipse(q+70,520,20,20);
376+
377+
//Frame
378+
fill(0,0,0);
379+
beginShape();
380+
vertex(q+262,520);
381+
vertex(q+258,520);
382+
vertex(q+230.5,450);//detail
383+
vertex(q+230,450);//detail
384+
vertex(q+225,430);
385+
vertex(q+230,430);
386+
vertex(q+235,450);//detail
387+
vertex(q+235.5,450);//detail
388+
endShape(CLOSE);
389+
ellipse(q+260,520,2.5,2.5);
390+
391+
//Main horizontal beam
392+
//fill(255,255,255);
393+
beginShape();
394+
vertex(q+231,450);//top right
395+
vertex(q+233,455);//bottom right
396+
vertex(q+130,475);//bottom left
397+
vertex(q+130,470);//top left
398+
endShape(CLOSE);
399+
400+
//Bottom beam
401+
beginShape();
402+
vertex(q+235,450);//top right
403+
vertex(q+237,455);//bottom right
404+
vertex(q+145,540.5);//bottom left
405+
vertex(q+145,535);//top left
406+
endShape(CLOSE);
407+
408+
//Left horizontal beam
409+
fill(0, 0, 0);
410+
ellipse(q+70,520,5,5);
411+
beginShape();
412+
vertex(q+69,518);//top left
413+
vertex(q+70,522);//bottom left
414+
vertex(q+145,540);//bottom right
415+
vertex(q+147,536);//top right
416+
endShape(CLOSE);
417+
418+
//Left vertical beam
419+
fill(255,255,255);
420+
fill(0,0,0);
421+
beginShape();
422+
vertex(q+69,518);//top left
423+
vertex(q+70,522);//bottom right
424+
vertex(q+132,473);//bottom right (change)
425+
vertex(q+132,468);//top right (change)
426+
endShape(CLOSE);
427+
428+
//Middle vertical beam / seat beam
429+
//fill(255,255,255);
430+
fill(0,0,0);
431+
beginShape();
432+
vertex(q+142.5,539);//bottom left
433+
vertex(q+145.5,534);//bottom right
434+
vertex(q+125,440);//top right
435+
vertex(q+120,436);//top left
436+
endShape(CLOSE);
437+
438+
//Seat
439+
fill(76, 75, 75);
440+
beginShape();
441+
noStroke();
442+
vertex(q+110,458);//top left
443+
vertex(q+115,459);//dip
444+
vertex(q+145,461);//top right
445+
vertex(q+140,465);//bottom right
446+
vertex(q+116,466);//bump
447+
vertex(q+108,461);//bottom left
448+
endShape(CLOSE);
449+
450+
//Handlebars
451+
noStroke();
452+
//fill(255,255,255);
453+
beginShape();
454+
vertex(q+225,430);//save
455+
vertex(q+230,430);//save
456+
vertex(q+240,425);
457+
vertex(q+245,430);
458+
vertex(q+250,430);
459+
vertex(q+235,405);
460+
vertex(q+230,405);
461+
vertex(q+237,420);
462+
vertex(q+227,425);
463+
vertex(q+225.5,426);//save
464+
endShape(CLOSE);
465+
}
466+
void torso(){
467+
fill(r,g,b);
468+
ellipse(q+125,440,40,40);
469+
fill(0,0,0);
470+
beginShape();
471+
vertex(q+105,435);
472+
vertex(q+105,433);//detail
473+
vertex(q+145,360);//lean of back
474+
vertex(q+180,360);//lean of back
475+
vertex(q+145,440);
476+
endShape(CLOSE);
477+
//Arms
478+
fill(255,255,255);
479+
beginShape();
480+
vertex(q+245,430);
481+
vertex(q+250,420);
482+
vertex(q+200,390);//elbow
483+
vertex(q+180,360);
484+
vertex(q+160,370);
485+
vertex(q+185,400);//elbow
486+
endShape(CLOSE);
487+
}
488+
void hands(){
489+
fill(247,206,190);
490+
ellipse(q+245,425,20,20);
491+
}
492+
493+
void head(){
494+
fill(247,206,190);
495+
//neck
496+
rect(q+155.5,350,17,10);
497+
//head
498+
beginShape();
499+
vertex(q+155,355);//btm left
500+
vertex(q+183,353);//btm right
501+
vertex(q+184,350);//chin
502+
vertex(q+185,340);//under nose
503+
vertex(q+190,340);//tip of nose
504+
vertex(q+185,325);//top of nose
505+
vertex(q+183,310);//top right
506+
vertex(q+160,310);//top left
507+
vertex(q+152,330);
508+
endShape(CLOSE);
509+
//Hair
510+
fill(0,0,0);
511+
beginShape();
512+
vertex(q+184,315);
513+
vertex(q+183,310);
514+
vertex(q+182,308);//top right
515+
vertex(q+160,309);//top left
516+
vertex(q+155,318);
517+
vertex(q+151,320);
518+
vertex(q+152,330);//bottom left
519+
vertex(q+150,340);
520+
vertex(q+155,345);//bottom right
521+
vertex(q+160,330);//inside corner
522+
vertex(q+167,328);
523+
vertex(q+168,337.5);
524+
vertex(q+172,337.5);
525+
vertex(q+173,320);
526+
vertex(q+174,318);
527+
endShape(CLOSE);
528+
}

0 commit comments

Comments
 (0)