SFML community forums

Help => Graphics => Topic started by: Jeckie on July 28, 2013, 10:49:52 am

Title: Problems with drawing map
Post by: Jeckie on July 28, 2013, 10:49:52 am
I'm trying to make a game but I have problem with graphics.
I don't know the name of the game but it's the one with paddle and ball where you need to destroy the bricks.
I made the paddle and ball moving and now I don't know how to make the bricks.
If you need pictures or code comment please.
Title: Re: Problems with drawing map
Post by: Nexus on July 28, 2013, 10:53:57 am
Breakout?

You can store the bricks in a container, and test them separately for collision with the ball. Since they're very few, it's hardly worth to optimize here; iterating through all of them won't be a big issue.
Title: Re: Problems with drawing map
Post by: Jeckie on July 28, 2013, 11:05:47 am
Yes, it's the breakout game.

How do you mean store them in a container?
Title: Re: Problems with drawing map
Post by: Nexus on July 28, 2013, 11:08:52 am
In a STL container such as std::vector.

If you haven't heard this term before, I strongly recommend to read a good C++ book, because the STL is basic knowledge which is very important in C++. It's probably the most often used part of the standard library.