Nama: Ahmad Fauzi

Kelas: 4IA05

NPM: 50411424

Berikut ini adalah kodingan game flappy derp yang dikerjakan oleh kelompok saya dalam bahasa pemrograman processing:

if (move2 == 975)
{
move2 = 250;
ba = random(0,500);
bb = ba + 180;
}
move2++;

if (move2== 750) score++;

if(move3 == 1)
{
ca = random(0,500);
cb = ca + 180;
}

rect(1000-move3,0,75,ca);
rect(1000-move3,cb,75,500);

if(1000-move3 < 290 && 1000-move3 >165){
if (height/2+h < ca || height/2+h > cb-40){
textSize(90);
fill(255,0,0);
text(“Game Over”,10,300);
textSize(50);
text(“highscore:”, 10,400);
text(highscore ,300,400);
ende=1;

}
}
if (move3 == 1225)
{
move3 = 500;
ca = random(0,500);
cb = ca + 180;
}
move3++;

x=x+y;

if(y<30) y++;
h = x/4;

if (y > 40)
{y = 40;}
if (y < -30)
{y= -30;}

if (basketmode==1)
{
background(0);
image(basket, 250,height/2+h);
image(Pen, 500-move1,aa+190);
image(Pen, 500-move1,aa-1150);

image(Pen, 750-move2,ba+190);
image(Pen, 750-move2,ba-1150);

image(Pen, 1000-move3,ca+190);
image(Pen, 1000-move3,ca-1150);
}
if (basketmode==2)
{
background(0);
image(bird, 250,height/2+h);
image(Cactus, 500-move1,aa+190);
image(Cactus, 500-move1,aa-1150);

image(Cactus, 750-move2,ba+190);
image(Cactus, 750-move2,ba-1150);

image(Cactus, 1000-move3,ca+190);
image(Cactus, 1000-move3,ca-1150);
}
if (score >= highscore) highscore = score;
text(score,10,50);
}

void mousePressed() {
if (mousemode==1)
{y-=40;}
if (mousemode==2)
{y-=50;}
if (mousemode==3)
{y-=60;}
}

keterangan:

untuk melihat hasil/outputnya dapat dilihat pada link video berikut ini.

Iklan

About Ahmad Fauzi

Saya seorang ikhwan biasa. Berasal dari negeri Nusantara. Anak pertama dari tiga bersaudara. Sekarang sedang melanjutkan studi di Universitas Gunadarma jurusan Teknik Informatika. Punya banyak impian (Book Writer, Soccer Coach, Building Village Muslim, etc). For Futher more follow me @FauziNgetweet

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s