Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Image Saute(){
- ImageIcon ico;
- Image img;
- String str;
- // Montée du saut //
- this.compteurSaut ++;
- if(this.compteurSaut <= 35){
- if(this.getY() > Main.scene.getyPlafond()){
- this.setY(this.getY() - 4);
- }else{
- this.compteurSaut = 36;
- }
- if(this.isVersDroite()){
- str = "/images/marioSautDroite.png";
- }else{
- str = "/images/marioSautGauche.png";
- }
- // Retombée du saut //
- }else if(this.getY() + this.getHauteur() < Main.scene.getySol()){
- this.setY(this.getY() + 1);
- if(this.isVersDroite()){
- str = "/images/marioSautGauche.png";
- }else{
- str = "/images/marioSautGauche.png";
- }
- // Saut terminée //
- }else{
- if(this.isVersDroite() == true){
- str = "/images/marioArretDroite.png";
- }else{
- str = "/images/marioArretGauche.png";
- }
- this.saut = false;
- this.compteurSaut = 0;
- }
- //Affichage
- ico = new ImageIcon(getClass().getResource(str));
- img = ico.getImage();
- return img;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement