Page 1 of 1

Scrolling Background screens

PostPosted: Sep 23, 2009 @ 3:17pm
by bcj
Hello..
i am new to EDGELIB. I am developing a game for Windows Mobile 6 sdk ....
in my game i have to scroll the background using tiles of images . can an yone help me in this topic...

please give me step by step procedure or some sample code to get this .

thanks in advance .

PostPosted: Sep 24, 2009 @ 10:16am
by edge
Hi,

The following approach could suit your needs:
- Use a tilesheet which could contain 256 tiles in 16 rows (in a 16x16 matrix)
- Create a large tilemap array which fits your game 'world'
- Add scrolling variables, xscroll and yscroll. For example, xscroll can be a value from '0' to 'mapwidth_pixels - screenwidth_pixels'
- When rendering, determine which tiles of your tilemap fit within the screen, then get the matching tile from your tilesheet and blit the image to the screen

Scrolling Background screens

PostPosted: Sep 30, 2009 @ 1:03pm
by bcj
thanks for your reply .
because i am a new learner of EDGELIB, i don't know the way of working with tileArray,and setting the world properties .
can you give another easy way or some code help to scroll a singe image(not as tiles) cotinuously as background.

cheers

PostPosted: Oct 2, 2009 @ 7:45am
by edge

Scrolling Background screens

PostPosted: Oct 28, 2009 @ 6:59pm
by bcj
Hai EDGE ,
thanks for your reply , i tried your code to get scrolling effect , but i can't get scrolling.

in my game i have 640x480 screen . and i have one background image of same size . so i have to scroll it on that screen.

please give me a simple way to scroll that image smoothly..

on that scrolling background , i have to move my sprite objects also . so give me the solution for that.

waiting for reply...
bcj

PostPosted: Oct 29, 2009 @ 9:41am
by edge
Hi,

If you need to scroll an image with the same size of the screen, you need to repeat that image horizontally or vertically (depending on your game).

To get more information on how to learn game programming techniques we recommend checking sites such as www.gamedev.net.

Scrolling Background screens

PostPosted: Nov 2, 2009 @ 8:02pm
by bcj
hi...Edge
Thanks for your response ..
i tried to get scrolling background..but i didn't get it correctly.

so can you please help me in this issue...and give me some solution , that how to get scrolling effect of background.

my game having 640x480 size , and have one image.
we can use image repeatively and can get scrolling..
can you give me solution in this way...
or your suggested way of solution.

if possible give me some example code of repeating the image Horizontally and vertically.

Waiting for reply... Thanks in Advance

PostPosted: Nov 5, 2009 @ 9:32am
by edge