Angry Physics
From Fabelier
int oriX=150; //centre du tronc en X
int oriY=500; //centre du tronc en Y
float g=9.8; //constante gravitationnelle
float k=1; //elasticite
float m=1.5; //masse de l'oiseau
float l0=50; // longeur du ressort au repos
int birdX=oriX;
int birdY=oriY;
//couleur du tronc
color yellow= color(255, 255, 0);
//couleur de l'oiseau
color red= color(255, 0, 0);
//image de l'oiseau
PImage bird;
void setup ()
{
size (800, 600) ;
bird=loadImage("/static/uploaded_resources/p.2336/bird.png");
}
void draw()
{
//fond d'écran
background (0, 0, 255) ;
fill(yellow);
rect(oriX-10, oriY, 20, 100);
if(mousePressed){
birdX=mouseX-20;
birdY=mouseY-20;
}else{
birdX=oriX-20;
birdY=oriY-20;
}
image(bird, birdX, birdY, 40, 40);
}