diff --git a/src/physique/MoteurPhysique.java b/src/physique/MoteurPhysique.java index 0b46d9d9aadad31a5c8cb312005839ea3884b634..35c30bd57c35413eae30b276c9048ea10ea252bc 100644 --- a/src/physique/MoteurPhysique.java +++ b/src/physique/MoteurPhysique.java @@ -33,6 +33,8 @@ public class MoteurPhysique { public boolean gravity=true; + + public float gravityValue=-0.04f; /** * Construit un moteur par defaut @@ -105,7 +107,7 @@ public class MoteurPhysique { { monde.balle.sprites.changeEtape("saut"); monde.balle.vy=3; - monde.balle.ay=-0.04; + monde.balle.ay=gravityValue; monde.c.enAir=true; } } diff --git a/test/testMario.java b/test/testMario.java index c78c57366f75110bba3dd5f571a05b1b22f34d21..ebbd59947b8a3409f9c38fadaecf6fd9a4e36b98 100644 --- a/test/testMario.java +++ b/test/testMario.java @@ -81,7 +81,6 @@ public class testMario { //on creer le moteur physique moteurPhys=new MoteurPhysique(); - moteurPhys.gravity=true; //On ajoute le monde au moteur moteurPhys.monde=monMonde; //on creer l'afficheur du monde @@ -95,7 +94,13 @@ public class testMario { // Ajout du jeu à la boucle maBoucle.jeuPhysique.moteurPhys=moteurPhys; + // Test to change the image //monMonde.balle.sprites.assignNewImage("hero2.png"); + // Test to change the gravity value + //moteurPhys.gravityValue=-0.4f; + // Test to remove the gravity + //moteurPhys.gravity=true; + maBoucle.lanceBouclePrincipale(); }