SFML 2.0 Lots of objects

Pages: 12
i had a look and i think i will keep following my one.

but i just want to know how they would work. of course i am going to finish my breakout first but i just want to know
Depending on how you go about it, one of several solutions may present itself to you in the course of plugging away at your breakout game. You did say you wanted to figure out things yourself. ;)

i knew i would regret saying that
but seriously how do they work
I came into this thread late, and you keep saying "they" and I don't really know what you're asking about.

I tried checking your earlier posts but didn't see anything. Can you restate what you're asking about?
what about a game like tetris. you don't know how many you will need so how would you do that?

basically how would making the bricks for tetris work
You could do that a number of different ways. First way that comes to my mind:

1) The "board" could be 2D grid where each value represents one square block.

2) The "current" piece can be an object that keeps track of which 'blocks' on the map it occupies.

3) When the current piece hits the bottom, you throw away the object, and update the 'board' grid, filling in the blocks that the piece occupied.

4) Check for full rows and remove them, giving the player appropriate points.

5) Check for "game over" if the block landed above the upper bound of the grid.

6) Start at step 2 with a new piece. Repeat until game ends.
Topic archived. No new replies allowed.
Pages: 12