This Visual Basic programming tutorial is designed to complement my Visual Basic Game Programming series, but is not limited to game design. It is designed to teach you how to create a custom VB Object Class, store your class to an object array, then create and delete multiple instances of that class on the fly.
In this VB programming video, we will be performing the following tasks:
1.) Building a simple game/application loop
2.) Build a (GDI+) graphical interface for painting objects to the main form
3.) Build a custom class with graphical properties and embedded timer objects and self-contained events
4.) Teach the objects to interface with the form environment while remaining autonomous
5.) Create a class/object array to store a desired number of objects from our class
6.) Use random numbers to dynamically generate new and diverse instances of our custom class
7.) Destroy specific objects by deleting them from our array when certain conditions are met.
PROJECT SOURCE CODE: http://www.aardaerimus.com/downloads/classtutorial/
Amazon Auto Links: No products found.
He’s right. 🙂 That would indeed be a good use, although one could still preclude a movement cycle by performing a similar look-up in the movement routine.
I’m very happy that the videos have been helpful for you! It’s gratifying to know that they’ve been instrumental in helping people grow. 😀
@Aardaerimus humm sorry i think i just mest my post up new to this ::)
@klutchego I was actually thinking about doing a tutorial on using MySQL with VB for storing user accounts and whatnot. 😀 Maybe I’ll try tackling this, but I HAVE to figure out this XNA before it kills me. hahah
GREAT INTRO MUSIC!!! wondering if you can tell me what song you were playing?
The presented information was just what I need for my application. While my application is not a game your presentation was ideal in understanding the use of classes. Thank you for providing me with a good start much appreciated.
cool
very useful tutorial!
I finished the tutorial and I learned a lot. Thanks for taking the time to put this together. I do a question though. I received a “Object reference not set to an instance of an object” error after running the code at line:
Sub DrawCritter()
Form1.G.DrawImage(spriteBmp, critterX, critterY, spriteRect, GraphicsUnit.Pixel)
Any idea what cause it?
Let me guess. You left the Y coordinate of your butterfly sprite at 0 just to see if we were paying attention. :-p
this step by step instruction video really helps, waiting for more to come
Thank you so much. I’ve been struggling… Huge help.
thanks for the tutorial. really helpful
lol. nice ! if possible, can u send me the full version of that piece ? It was so nice ! I love it and somehow the melody is stuck in my head
Hello, Pharoah Cypher. Which part of the video are you stuck at?
Great tut, thanks a lot
much faster than reading books.
wishes from morocco
Thanks Aardaerimus, this is a great series of tutes! I’m moving my MS Office VBA experience into creating VB programs & this is a great way to learn. Kepp em coming !! : )
True although i watched all of it and lol did not realize it was that long ::) time always goes quick when u enjoying something.
Hey, Aardaerimus!!!
I’m still waiting for the promised mouse controll movement video + by steps by timer (few steps per turn) ….!!! j/k 🙂
Thanks for great video once again!
Vote for an updated classic Visual Basic 6.0 at
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3440221-bring-back-classic-visual-basic-an-improved-versi
Programming is very interesting and creative thing if you do it with love. Your blog code helps a lot to beginners to learn programming from basic to advance level. I really love this blog because I learn a lot from here and this process is still continuing.
Love from Pro Programmer
It is very help full to me….thanks a lot…..
just one request …from where I can find your previous videos.
I mean from beginners..
please kindly get the camera close a little bit so we can see the codes. thanks!!
wow!very useful THX in millions
Great Video! I know this wasn’t a primary focus of your video, but I’ve been looking up class creating stuff to see how to properly use Private, ReadOnly and Public Variables, Properties, and Methods within a class. I understand all your declarations except the “Public Sub SpriteSource()”. It seems since it’s only usefully referred to by the “Set” part of the “CritterType” property it might be more securely declared as “Private.” Do I understand that correctly or am I missing some detail?
@TheOrneryNerd Hahah RIght you are! 😀 I need to get on that.
I’m in a real pickle right now, because I want to carry on using XNA in place of GDI+, but custom classes are not playing well with the main form. I’m hoping that rm2kdev can shed some light on the situation so I can move forward with the tutorials.
Really good and informative tutorial at a pace I could keep up. Thanks!
I started to learn game programming a few years ago now, but gave up a couple year ago as HDD blew up and i lost all my work. This video is just what i needed to refresh my memory of all the fundamentals. Really great tutorial, i look forward to watching more of your videos tomorrow! 😀
I’m new to VB and the Application class isn’t available on my system. How do I fix this? I really want to follow along.
@Aardaerimus True although i watched all of it and lol did not realize it was that long ::) time always goes quick when u enjoying something.
@Aardaerimus
need that coffee now ::)
Great, I am glad to find your videos again, I followed all your work from VB-ToolBox
Thank you and hope to hear or see your work always , I am going to subscribe here as its different from vbtoolbox videos.
the programming name is good but codes not clear
Another Great tut, Thanks =D
Right you are, Paul! I’m not sure what I was thinking there. 😛
This is a really old video and my style of coding and proficiency has changed dramatically since I made some of these older videos.
Any more, I never even use the class “property” builders as I’ve found no tangible benefit over standard subs and variables.
It’s much easier to simply define a publicly accessible variable as a property with one line of code, than a Property base that immediately begins with eight lines. 😀
My coworker points out that if you’re validating a variable every time its changes, the setter is a great place to do that rather than in each place you change the variable. For instance, if you wanted to make sure a character didn’t move off the map, you could have the setter check if new coordinate will be within the map and if it’s not, set the coordinate to the edge of the map.
On another note, thanks for the videos! You’re channel’s been a big part of my programming development!
Thanks, NoLongerBe! 😀
I compose all of my own music, so it’s an original piece.
Very Nice 😀
Thank you, thank you! 😀
I played this on my keyboard and recorded with with Audacity (free sound recorder).
im not sure vb is the software to use for game making but you can make some nice programs with it. i have
I created the program as a Console app by accident instead of a Form app. It’s working now. The Application.DoEvents() method isn’t available in the Console program.