Processing Animasi Pemandangan Desa Bergerak
Tuesday, June 5, 2018
Add Comment
Pemandangan desa-Selamat pagi, kali ini duinoweb akan memberikan sedikit source kode untuk kita semua dimana source kode ini dapat digunakan pada saat mengerjakan mata kuliah Interaksi manusia dan komputer (IMK) source kode ini hanya bisa dijalankan di software processing. baiklah tanpa basa - basi silahkan comot souce kodenya.
Processing Animasi Pemandangan Desa Bergerak |
Source Code :
1: float x, y, z;
2: float size = 75;
3: float M,K;
4: void setup()
5: {
6: size(1000,550);
7: frameRate(30);
8: }
9: void draw()
10: {
11: int d;
12: d=second();
13: background(153,170,0+50*d,0);
14: fill(#606421);
15: rect(0,300,1000,250);
16: //gunung
17: fill(#14D815);
18: triangle(550,300,1010,300,850,90);
19: triangle(150,300,570,300,400,120);
20: // jalan
21: fill(0);
22: quad(10,300,150,600,300,600,30,300);
23: rect(0,450,1000,100);
24: stroke(252,252,252);
25: strokeWeight(2);
26: line(245,630,170,520);
27: line(160,510,120,450);
28: line(115,440,75,380);
29: line(70,370,21,300);
30: line(0,500,70,500);
31: line(200,500,270,500);
32: line(290,500,360,500);
33: line(380,500,450,500);
34: line(470,500,540,500);
35: line(560,500,630,500);
36: line(650,500,720,500);
37: line(740,500,810,500);
38: line(830,500,900,500);
39: line(920,500,990,500);
40: noStroke();
41: //matahari
42: fill(222+50*d,222,0);
43: ellipse(900,70,100,100);
44: //rumah
45: fill(255,0,255);
46: triangle(155,350,125,375,185,375);
47: fill(20,100,200);
48: rect(125,375,60,30);
49: fill(0,100,0);
50: arc(120,405,30,50,(180*PI)/180,(0*PI)/180);
51: fill(0+50*d,250,250);
52: rect(140,375,15,10);
53: fill(#F0C330);
54: triangle(165,415,225,415,195,390);
55: fill(20,100,200);
56: rect(165,415,60,30);
57: fill(0,100,0);
58: arc(120,405,30,50,(180*PI)/180,(0*PI)/180);
59: fill(0+50*d,250,250);
60: rect(170,415,15,10);
61: fill(#F70A0A);
62: triangle(700,340,800,340,750,290);
63: fill(20,100,200);
64: rect(700,340,100,100);
65: fill(0,100,0);
66: arc(120,405,30,50,(180*PI)/180,(0*PI)/180);
67: fill(0+50*d,250,250);
68: rect(740,390,15,50);
69: rect(760,380,15,10);
70: noStroke();
71: fill(200,100,0);
72: triangle(120,320,90,340,150,340);
73: fill(200,0,0);
74: rect(100,340,40,20);
75: //pohon
76: fill(#369820);
77: triangle(850,350,890,350,870,320);
78: triangle(850,370,890,370,870,340);
79: triangle(850,390,890,390,870,360);
80: fill(#293E25);
81: rect(865,390,10,20);
82: fill(#369820);
83: triangle(800,350,840,350,820,320);
84: triangle(800,370,840,370,820,340);
85: triangle(800,390,840,390,820,360);
86: fill(#293E25);
87: rect(815,390,10,20);
88: fill(#369820);
89: triangle(600,350,640,350,620,320);
90: triangle(600,370,640,370,620,340);
91: triangle(600,390,640,390,620,360);
92: fill(#293E25);
93: rect(615,390,10,20);
94: fill(#369820);
95: triangle(550,350,590,350,570,320);
96: triangle(550,370,590,370,570,340);
97: triangle(550,390,590,390,570,360);
98: fill(#293E25);
99: rect(565,390,10,20);
100: fill(#369820);
101: triangle(500,350,540,350,520,320);
102: triangle(500,370,540,370,520,340);
103: triangle(500,390,540,390,520,360);
104: fill(#293E25);
105: rect(515,390,10,20);
106: //awan
107: y = y + 0.8;
108: translate(y-200, height/2-2*size/2);
109: fill(#E8EFF5);
110: ellipse(450,-50,70,45);
111: ellipse(500,-50,85,65);
112: ellipse(540,-50,70,35);
113: ellipse(700,-100,80,50);
114: ellipse(750,-100,95,75);
115: ellipse(780,-100,80,55);
116: ellipse(815,-100,75,40);
117: ellipse(250,-100,80,35);
118: ellipse(300,-100,80,45);
119: //mobil
120: fill(106,90,205);
121: rect(100,250,100,50);
122: fill(72,61,139);
123: rect(200,265,40,35);
124: fill(255);
125: rect(210,272,20,20);
126: fill(65);
127: ellipse(130,300,30,30);
128: ellipse(200,300,30,30);
129: }
0 Response to "Processing Animasi Pemandangan Desa Bergerak"
Post a Comment