Tile on SDL_Surface problem (newbie user)!

Hi all !

here is my problem: I want to draw a background image from a tile that is 32*16 on a surface that is 640 * 480 .
it’ s for my fisrt try at sdl and also programming game and i have try many tutorial on net and read a lot of message in the mailling list but i (still) havent found what i’am looking for.
well if some expert user could give me an hand by showing the way how to do this it would be cool.
for my first try i want to design a breakout game :according to you(all) is it not too much for a noob?

i (try to) dev with DEV C++ and sdl 1.2.7 running on windows xp.
PS: i am after that since 1 week now and it make me crazy please give me some help :);

see you ! and thanks!

junku wrote:

Hi all !

here is my problem: I want to draw a background image from a tile that
is 32*16 on a surface that is 640 * 480 .

it’ s for my fisrt try at sdl and also programming game and i have try
many tutorial on net and read a lot of message in the mailling list
but i (still) havent found what i’am looking for.

Did you look at the SDL examples ? They are located in the test/ folder
in the SDL source distribution. That’s the most basic examples you can
find, they can be a good starting point. Look at testsprite.c for
example, and try to understand how each part works : initialization,
animation loop, cleanup part. Then you can fidle with the source a bit,
change surface properties, add a static sprite on top…

(yes, breakout seems reasonable as a first goal, although you might want
to do “breakout without bricks” at first. At least, that’s how I like to
proceed : as a rule of thumb, I always try to have intermediate goals
and intermediate code testing. So at first, do a moving paddle, then add
the ball, then make it bounce against the walls/the paddle, the add a
score, then add the bricks, then the bonus…)

Stephane

That is a common problem when people begin
to develop 2D tile based games.

I suggest that you read the following book excerpt

http://www.gamedev.net/reference/programming/features/j2me11/

It is aimed for J2ME developers, but I think that
it is simple enough for you to get it.

Cheers,
Paulo Pinto

junku wrote:> Hi all !

here is my problem: I want to draw a background image from a tile that
is 32*16 on a surface that is 640 * 480 .
it’ s for my fisrt try at sdl and also programming game and i have try
many tutorial on net and read a lot of message in the mailling list
but i (still) havent found what i’am looking for.
well if some expert user could give me an hand by showing the way how
to do this it would be cool.
for my first try i want to design a breakout game :according to
you(all) is it not too much for a noob?

i (try to) dev with DEV C++ and sdl 1.2.7 running on windows xp.
PS: i am after that since 1 week now and it make me crazy please give
me some help :);

see you ! and thanks!