I have it so that up to a maximum of 300, 150 or 75 steps, a code repeats, increasing image_xscale by 1/4, 1/2 and 1 unit respectively until it collides with a wall object. The maximum range of the beam is 1200 pixels.
At that point, it is destroyed and replaced by a non-colliding (blank collision mask) version of itself with the same sprite, which fades away over 16 frames.
Whenever the beam is very long (about 800px or more), the game lags horribly, dropping to about 3-10 fps from 50-60 when the beam is less than about 400 pixels long.
For each of the three sets of values for code, the game lags the same amount.
My question is this: What is causing my game to lag: the repeating code or the fact that there are these relatively small sprites being stretched to 800+ pixels?
Edited by bjshnog, 23 August 2012 - 04:16 AM.