   [.net] Game Tiles in C#
  I have a a map created with a 2D array of PictureBox. I also have a main sprite that I can move around that is a PictureBox. The thing is, if my 2D array is more than 20 (i.e. tiles[25][25]) I can move my main sprite a few pixels, then it will just stop moving. Then I'll have to release the key, then repress to make it move.I know that it's probably not the most efficient way, but can someone explain to me why this is happening? Also how would you guys create a basic 32x32 game tile? Which Control would you guys extend? Here's some code/psuedo code to explain things. // I have a timer, interval set to 16 millisecondstimer.Interval = 16;// timer tick handler calls drawherovoid TimerTick(.....) DrawHero();private void DrawHero(){ if( up ){hero.Location = new Point( x, y-=3 );hero.Refresh();}if( down ){hero.Location = new Point( x, y+= 3 );hero.Refresh();}if( left ){hero.Location = new Point( x-=3, y );hero.Refresh();}if( right ){hero.Location = new Point( x+=3, y );hero.Refresh();}}Well thats about it. Hope yall can help.Thanks.Triele   
  Well, you should not have a picture box per tile because that will increase message/events/redrawing overhead a lot, especially if you have lots of tiles.A better solution would be to create a single Map (derived from Control for instance) class which contains an array of Tiles (and Tile is not derived from any on control). In the Map.Paint() method you simply go through your array of Tiles and render them on the client area of the Map instance.The problem you currently are having could be that focus on the PictureBox is lost after a few pixels movement due to some event or other thing in your app.   ;  Thanks. Yeah, I kinda figured that was the problem, so I already went ahead and did what you mentioned, and things are 'kinda' working now. Ahhh!!! Damn collision detection...I'll save that for another day.Triele