Feb 25th, 2004, 09:21 AM
Tutorial [Move with Keypress] NMs Game tutorial 0.1
This is a tutorial to show you two ways of moving objects on a form in VB. The code has only been tested in VB6, but I guess it can be used for VB5 and easily implemented in .Net too. You should have some knowledge of arrays, and some knowledge of simple VB programming from before. It is not recommended that you know anything about APIs but you can manage the second bit a bit better if you know it. But if you have never used it at all. Don't turn around. The two ways I am going to show you are more or less equal when it comes to performance. The first way is (the way I did it for small games) by using a array for checking what keys that are hold down. The second method I will show is using an API call. But since this is not improving the speed in VB, I don't like to use it because it looks more complicated to use API calls for persons that are not used to it. I will only talk about the code here. And make a final example using both methods that you can download and play with in the end of this tutorial. So here we go.
Last edited by si_the_geek; Feb 25th, 2004 at 10:57 AM.
Click Here to Expand Forum to Full Width