background going up instead of right..
              in 
             Programming Questions 
              •  
              1 year ago    
            
 
           
             hi, currently my background is going up with a loop
            
             
            
            
             
            
            
             
              
               
              
              
               
                
               
               
                
               
               
                
               
               
              
               
              
               
           
 
            
           
             i want it to loop to the right,
            
            
             could someone help?
            
            
                int variabele1;
               
               
                int variabele2;
               
               
                float y = 1;
               
               
                float speed = 4;
               
               
                PImage d;
               
               
                void setup() {
               
               
                  size(600,600);
               
               
                  frameRate(25);
               
               
                  smooth();
               
               
                  d = loadImage("background.jpg");
               
               
                  oscP5 = new OscP5(this,"239.0.0.1",7777);
               
               
                }
               
               
                void draw() {
               
               
                  y+=speed;
               
               
                  y%=height;
               
               
                  image(d, 0, int(y));
               
               
                  image(d.get(0, d.height-int(y), d.width, int(y)), 0, 0);
               
               
                }
               
              
               thnx already
              
             
              
              1  
            
 
            
 
 
           
 
            