   c# Tile Engine confusion...
  I''m new to directx & directdraw and im using C# to experiment in...I''ve tried several simple things and have looked through several things. (among other "http://www.kuhnstall.de/tutorials.html" which was really good)And now im trying to make a little tile based DD game and i''ve come upon several problems.I have a 2d array loaded with tiles and can succesfully render it to the screen but i want it to scroll and i cant really understand how to do this.Im using an offset to move the tiles but when it goes outside the screen it crashes (negative value)How do i make the tiles go outside the screen if i cant use negative values ?Im not a c++ guru (far from it =) ) but they seem to use a "wrapper" ?A c# code sample on this would make wonders, im sadly not well versed in c++ so a code sample of that may confuse me =(Is there an offset function which moves the tiles outside the screen without making a negative value ?_?Someone have also talked of having a primary layer secondary layer and a "map layer" ?Please help clear my confusion... 
  negative values should work..hum this is c++ but it cant be that different? int cx,cy;//globalsint screen_scoll( int x, int y) { if(x == 0){cx --;}if(x == SCREEN_W-1){cx ++;}if(y == 0){cy --;}if(y == SCREEN_H-1){cy ++;}} for (int x=0;x< MapWidth;x++) for (int y=0;y< MapHeight;y++) {int sx = x*tilesize -cx; int sy = y*tilesize -cy; blit(tile,bmp,0,0,sx,sy,tile->h*2,tile->w*2); /* disregard the drawing syntax, not direct draw. but should be somewhat the same.*/};  Was gone for a couple of days thus the late response...Anyway, i decided to use yaboc as a foundation (check link in first post) instead of building it from scratch...This time it doesn't crash but i dont get a response at all... C# Codeprotected BitmapObject[,] boBlocks;...boBlocks[i, j] = new BitmapObject("test.Bitmaps.Blocks.block" + j.ToString() + ".bmp", BitmapType.TRANSPARENT, renderDevice);  ...public void DrawBlocks(Surface TargetSurface){for(int j = 0; j < iRows; j++){for(int i = 0; i < iColumns; i++){// Check if block is visible and draw itif(boBlocks[i, j].Visible){boBlocks[i,j].Position.Offset(200,200); //A big number but it's just a test to see if i get a response...boBlocks[i, j].DrawBitmap(TargetSurface);}}}}The offset code doesn't seem to do squat...And i haven't found a code sample that demonstrates this in c# yet As a side note i've tried TargetSurface.DrawEllipse(1400,40,-500,50);which can be drawn however i want it to...   [edited by - Zircon on February 7, 2004 9:07:33 AM];quote:I have a 2d array loaded with tiles and can succesfully render it to the screen but i want it to scroll and i cant really understand how to do this.Im using an offset to move the tiles but when it goes outside the screen it crashes (negative value)Forgive my sheer ignorance, but why not just keep the entire rendered scene "somewhere in the background" (hidden bitmap or whatever) and only take "snapshots" to render what the player sees?Assuming the player''s view is a large rectangle, x, y being the upper left, and x2,y2, being the lower right, why not just increment the right variables (x/x2 for scrolling left-to-right, y/y2 for up-and-down) and take a "snapshot" from the entire scene at the given rectangle?You can simulate scrolling in that fashion by incrementing the variables and taking a new snapshot every frame.;  Interesting, I never thought of it that way before.The only problem now is how to render it that way...I guess i could just save the entire map as a big bmp/jpg/pcq and then blit it...But wont that create problems if i would want to develop it further, like with having half a unit or building on the edge of the screen, that means im back at the original problem...c# has very little info/tutorials in this area so i think i'll move back to c++ and check out the wealth of information...   [edited by - Zircon on February 11, 2004 2:33:37 PM];  you may be interested in my 2d tutorial serieshttp://jnrdev.weed-crew.netor my complete open source jump''n''run (source download below the screenshot)http://jnrdev.weed-crew.net/index.php?section=screenshots&screenshot=smw097 