# Infinite? I think

How would a person make a grid 8 square width and infinte amount of squares up? Any help appreciated

it depends what you are going to draw on them

``````for i=1,math.huge do
-- draw stuff
end
``````

This maybe, why exactly do you need an infinite amount of squares?

@GriffinC Not sure if this is what you’re after, but you can change the value of the 30 in the “for y” loop to a large number.

``````
displayMode(FULLSCREEN)
supportedOrientations(PORTRAIT_ANY)

function setup()
size=50
offset=150
end

function draw()
background(40, 40, 50)
fill(255)
for x=1,8 do
for y=1,30 do
rect(x*size+offset,y*size,size,size)
end
end
end

``````

@dave1707 - problem isn’t adding rects together, it’s managing an increasing number of them. Even if you only draw those that fit on the screen, you may have an increasing amount of memory required. It all depends what you are putting on the screen. If it’s just sprites, you can store their positions without having to store the actual image rects, but if you have to store all the images as you move as long, you may run into memory problems.

So as I said, it depends on what you are drawing on that infinite screen…

@Ignatz I just answered his question, a grid 8 squares wide going up the screen. I didn’t make it infinite, but he can change it to what he needs. Without more information about what he wants to do, it’s a waste of time to do more. I agree, you don’t need an infinite amount, just what shows on the screen and a table to hold whatever information you’re going to use about the squares.

Revised I only need 15 squares in height.

I’m trying to figure out how to make the stacker game you see in arcades and stores. 3 blocks slide right to left you tap to make it stop. Then a new row pops up above a little faster. If one of the blocks isnt completely on the 3 blocks below it you will have 2 blocks on top of the row below it and one will fall to the bottom and disappear. It keeps picking up speed you lose another block its 1 square going back and forth. You lose all the squares. You’re done

If you don understand the above heres a pic http://imgur.com/f7uIbVb

BTW if the game picture looks interesting to you the developer gave me a promo code to share with someone. 4 game modes. Powerup store coming soon. So yeah just comment if you would like it