1

When I try to change my game speed after certain steps, the random background generator I have doesn't work anymore. I had this problem in the past if my game speed wasn't factor of the width resolution number. I tried with 4,5 and 8 but I still get the problem.

Example: https://gyazo.com/6e544a88f5b2b556d3a985944c38faff

         //Game speed
          global.spd = -5; 

         // Viteza background
          background_index[0] = bck_1;
          background_hspeed[0] = global.spd ;

        // Backgrounds

         background_index[0] = bck_1;
         background_hspeed[0] = global.spd ;

         background_index[1] = choose(bck_2,bck_1)
         background_hspeed[1] = global.spd ;
         background_x[1] = 960
         background_y[1] = 0


         //Change Backgrounds

          if  (background_x[1] == 0)
         { background_index[0] = choose(bck_2,bck_1,bck_3,bck_4)
         background_x[0] = 960
          }
         else
         if (background_x[0] == 0)
         { background_index[1] = choose(bck_2,bck_1,bck_3,bck_4)
         background_x[1] = 960
           }

EDIT: Got it! https://www.reddit.com/r/gamemaker/comments/4z7nkh/changing_game_speed_is_destroying_my_backgrounds/

0 Answers0