I'm making an agar.io clone and I want to render a grid in the background, here's the code:
X = -(CAMERAX MOD 50)
DIST = 50*(400/CAMERAW)
WHILE X <= CAMERAW
GLINE X, 0, X, 240, RGB(200,200,200)
X = X+DIST
WEND
Y = -(CAMERAY MOD 50)
DIST = 50*(240/CAMERAH)
WHILE Y <= CAMERAH
GLINE 0, Y, 400, Y, RGB(200,200,200)
Y = Y+DIST
WENDThe grid stutters when the camera moves, why?
And a screenshot of what it looks like:
You were going to have to calculate I and J eventually, so I added that in as well.
There doesn't seem to be any flickering, from my observation, everything goes smoothly.
Change the 50 (CMX MOD 50) TO (CMX MOD DX)
Then it will support rectangles as well as squares
Does that help?