torifoster
YaBB Newbies
Offline
Posts: 6
How do you make increments greater than 1
Nov 25th , 2008, 10:55pm
I would like to make a variable increase by 15 each time. How do I do this? I've tried instead of: countZ++; writing: countZ + 15; but was unsuccessful. I also tried this: if (countZ < imagesB.length * 15) { countZ + 15; } Which didn't work either. I have this rather unwieldy section of code: image(imagesB[countB + 1], xpos - 15, ypos + 400); image(imagesB[countB + 2], xpos - 30, ypos + 400); image(imagesB[countB + 3], xpos - 45, ypos + 400); image(imagesB[countB + 4], xpos - 60, ypos + 400); image(imagesB[countB + 5], xpos - 75, ypos + 400); image(imagesB[countB + 6], xpos - 90, ypos + 400); image(imagesB[countB + 7], xpos - 105, ypos + 400); image(imagesB[countB + 8], xpos - 120, ypos + 400); image(imagesB[countB + 9], xpos - 135, ypos + 400); image(imagesB[countB + 10], xpos - 150, ypos + 400); image(imagesB[countB + 11], xpos - 165, ypos + 400); image(imagesB[countB + 12], xpos - 180, ypos + 400); image(imagesB[countB + 13], xpos - 195, ypos + 400); image(imagesB[countB + 14], xpos - 210, ypos + 400); image(imagesB[countB + 15], xpos - 225, ypos + 400); image(imagesB[countB + 16], xpos - 240, ypos + 400); image(imagesB[countB + 17], xpos - 255, ypos + 400); image(imagesB[countB + 18], xpos - 270, ypos + 400); image(imagesB[countB + 19], xpos - 285, ypos + 400); image(imagesB[countB + 20], xpos - 300, ypos + 400); image(imagesB[countB + 21], xpos - 315, ypos + 400); image(imagesB[countB + 22], xpos - 330, ypos + 400); image(imagesB[countB + 23], xpos - 345, ypos + 400); which I wanted to simplify a little by using a variable increment. Or at least I was going to try. Any help is appreciated.