Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Please help me before the 09/05/16 !

$
0
0

hey i have some problem with this program. When i want to jump it's make a strange thing. Can you help me with this ?

`Camera worldCamera; int appuye=0; int reappuye=0; int montee=0; int Yp=0; int Pg=0; int Yb=210; int xb=20; int deplacementB=1; void setup(){ size(400,400); worldCamera = new Camera(); ellipse(xb,Yb,10,10);

}

void draw(){ background(255); /PImage background = loadImage("bg_campagne.jpg"); image(background,-xb,-50);/ translate(-worldCamera.pos.x, -worldCamera.pos.y); worldCamera.draw(); fill(255,0,0); MAP(); Redessiner_Tout();

//déplacement de la balle if (appuye==1){ if(reappuye==0){ reappuye=1; montee=1; Yp=0; }else{ if(montee==1 && reappuye==1 && Yp==0){ Pg=Pg+1; Yb=Yb-(Pg/Pg); }else{ if(Pg==50){ montee=0; Pg=0; appuye=0; }else{ if(Yp!=0){ Yb=Yp; reappuye=0; }else{ Yb=Yb-1; }}}}} //fin déplacement }

void MAP (){ plateforme(0,200,50,10); plateforme(80,160,50,10); plateforme(160,120,50,10); plateforme(240,80,50,10); plateforme(280,120,50,10); plateforme(320,160,100,10); plateforme(440,120,50,10); plateforme(520,80,50,10); plateforme(600,80,100,10); plateforme(720,80,100,10); plateforme(840,120,50,10); plateforme(880,160,100,10); plateforme(1000,320,200,10); plateforme(1200,280,50,10); plateforme(1280,240,50,10); plateforme(1360,200,50,10); plateforme(1440,160,100,10); plateforme(1560,160,50,10); plateforme(1640,160,50,10); plateforme(1720,160,50,10); plateforme(1760,200,50,10); plateforme(1800,240,50,10); plateforme(1840,280,100,10); plateforme(1960,240,50,10); plateforme(2040,200,50,10); plateforme(2120,160,50,10); plateforme(2200,120,200,10); plateforme(2360,80,50,10);

} void plateforme(int x,int y,int h,int l){ rectangle(x,y,h,l); physique(x,y,h,l); }

void rectangle(int x,int y,int h,int l){ rect(x,y,h,l); }

int physique(int x,int y,int h,int l){ Yp=y-10; return Yp; }

class Camera { PVector pos; Camera() { pos = new PVector(0,0); }

void draw() { xb=xb+2; pos.x = xb-20; } } void Redessiner_Tout() {

fill(255); ellipse(xb,Yb,15,15); fill(255);
} void keyPressed(){//SAUT if (key ==' '){ appuye = 1;}}

` PS: sorry for my bad english i'm french ;)


Viewing all articles
Browse latest Browse all 2896

Trending Articles