Hi,
I am making a scrolling platform game, and the grass that my character is standing on needs to be on the bottom of the ground for a while, when scrolling and i used the following simple code
As you can see the Y-coordinate is always the same and he adds up every 128 pixels on the X-coördinate ( 193 + 128 = 321 and 321 + 128 = 449 and 449 + 128 = 577 and so on ). Is their an easier code to just let my object let say multiply itself on that Y-coördinatie with 128 pixels for 10 times or so? something with a counter? I don't find the proper code for that
addObject(new Hoofdplatform(), 65, 385);
addObject(new Hoofdplatform(), 193, 385);
addObject(new Hoofdplatform(), 321, 385);
addObject(new Hoofdplatform(), 449, 385);
addObject(new Hoofdplatform(), 577, 385);
addObject(new Hoofdplatform(), 705, 385);
addObject(new Hoofdplatform(), 833, 385);
addObject(new Hoofdplatform(), 961, 385);