Guys,
Here's my code. I'm an apprentice on processing
int posx =200; //position of the left vertex of our ship
int posy =275; // position of the bottom vertex of our ship
void setup() {
size(400, 400);
background(0, 0, 0);//uzay boslugu
stroke(183,141,26);//yeryüzü kahverengi
noFill();
}
void draw() {
noStroke();
fill(183,141,26);
rect(0,350,400,50);
for(int k =360 ; k<390; k=k+10) {
for (int i=10 ; i<390 ; i= i+40 ){
if (k==370 ) {
k=k+5;
}
noFill(); //taşlar çiziliyor
rect (i, k, 10, 5) ;
}
}
//drawing the spaceship
stroke (2);
fill(139,160,11);
rect(posx,posy,25,60);
fill(255,0,0,1);
triangle(posx + 12,posy - 23,posx + 32,posy,posx-7,posy);
for (int i=187 ; i<212; i=i+3) {
stroke(255,0,0,1);
line(posx,posy+60,i,posy+75);
}
for (int i=215 ; i<240; i=i+3) {
stroke(255,0,0,1);
line(225,335,i,350);
}
}
I want to build a game similar to this:
http:// phet.colorado.edu/sims/lunar-lander/lunar-lander_en.html
Could anybody help me? (want to use some gravity and some velocity)
Thanks