Hello, i am new to this site, and also new to programming with visual basic, infact i only just started laerning it at IT class about 4-5months ago.

At the moment i am trying to build a program which creates source code for a program known as DSGameMaker. The program records the position my mouse is over a box which is 256px x 192px, the size of a DS screen, then outputs the location in the form of a "set x to variable " scenario. the aim is to get a long list of positions, which in the end in the DS game moves a sprite every frame, to the location that the mouse was recorded in, giving one the ability to make custom animation paths, like the freestyle custom path drawing tool in ms powerpoint.

One problem i am facing, is that the code operates inside a timer event, which until recently i have found does not work well reading large amounts of code. when i tried running the code that moves the sprite, in the recording timer event, my framerate dropped to about 5fps, when i moved it to a seperate timer event, it went down to maybe 20-40fps, asuming it should have been 60 to appear normal.

What i was attempting to do, to make the application more versatile, was make an rpg walker, which allows you to move a sprite over the box, and record its location, as to achieve a motion animation which could be used in rpg games like pokemon (or at least pokemon-like games), since moving 32pixels at a time and straight lines, is a bit tough with a mouse.

What i need, since i cant find one, is an example of a game loop that works with vb 2008! because timer events just aint cuttin it.
I dont yet understand the functions and all, which are neccesary to create it.

Could someone please post an example code? thanks!
I want to build a game soon as well, and for obvious reasons would find this very helpful.

Also some pointers on improving the code would be greatly appreciated.