VB Game Programming Tutorial – Part 1 – Creating an NPC Class

In this Visual Basic game programming tutorial, I will be showing you how to construct an NPC class which will allow you to bring other entities into your game.

As a base, I’ll be using the source code from my tutorial on saving & loading map data:

TinyEdit – Experimental Map Maker:

Tip Jar:



ZoFlux says:

wow i duno where to start with computing D: im doing basic tutorials on coding and stuff

IKomang Sukanata says:
Aardaerimus D'Aritonyss says:

I think I showed menu creation in the Adventures In XNA series in parts 4e through 4g.

It’s pretty much identical to doing the title menu. Granted, the process could probably be refined a bit to make it more dynamic, but it’s reusable as it is.

Essentially, you just create a new “screen” and give it focus for input, then add a list of menu items (we had a simple MenuItem class) cycle through the indices with key presses, and draw the selected item a different color than the rest of the items.

FusionLord says:

Love the new thumbnails of the videos…. haven’t watch these, been up 24 hours and need sleep but wanted to comment on the awesome thumbnails

Prageeth Niranjan says:

Thank you I learn a lot from this tutorial It was very use full I don’t know weather you have finished the map editor I have find a way to put the npcs to the map with Map handler class modification http://www.prageethniranjan.tk/AdventureInXNA.zip

Noobular says:

Good to see a continue 🙂

Aardaerimus D'Aritonyss says:

And thank you for watching! I’m very glad that they’ve been helpful to you! 😀

JackPS9 says:

Hows the updates on the map editor going?

iProgramMC says:

Please do connected tiles in VB.net!

Aardaerimus D'Aritonyss says:

Hey there, ToniToTskiie!

If you go to my website (aardaerimus (dot) com) I have a link to the page with the NPC builder. 🙂 You should be able to just grab the naked toon template from that page, I’m fairly certain.

Aardaerimus D'Aritonyss says:

😀 I’ll try to get the rest of it uploaded tonight, too.

LGxCP says:

When I walk around, by background is pretty glitchy. I have the back color set to transparent and everything. Can you help?

JackPS9 says:

any chance of a tutorial for a menu in game? so hit esc or something to get something like Save Game, Characters Items and that cause when I tried doing it It didnt show up…..

Aardaerimus D'Aritonyss says:

Made great progress earlier on in the week and then got busy. My big step forward was figuring out how to embed textures/png files directly into the workspace and map files.

This is a huge step forward because I can abandon the need to pre-load graphics in the game, and instead load the graphics directly from the map file and reference them with an alias. 😀

Aardaerimus D'Aritonyss says:

Many thanks, xFusionLordx! 😀 I wasn’t sure how it would turn out or if it would add much to the visibility of the series, but now I feel it’s a huge improvement.

It’s a lot of extra work, but I’m thinking of replacing my other thumbnails as well.

JackPS9 says:

I just copied over the Debug screen and it wasnt working, different button, name but wasnt working, …… I’ll just inbox you instead.

Aardaerimus D'Aritonyss says:

Once you create the new screen class, you’ll add an input handler (i.e, ESC key) in the WorldScreen class to activate it (add it to the screenmanager). In your Menu you’ll have a list of menu items and you can use a variable to track the index and cycle through the list with your W/S or Arrow keys. 🙂

James Barr says:

Made that

Aardaerimus D'Aritonyss says:

I was just playing around with the menu system and made some big improvements. 😀

I added a MenuBase to eliminate a great deal of code redundancy. Also added a sub menu class but I can foresee issues with that, do to behavioral differences between menu options.

FusionLord says:

what you can do is add a variable for menuEntry class with the type of Action, then when initializing the menuEntry then in handle input call menuEntry[menuSelect].Action.Invoke() . This also makes it easy to add mouse control to the menus

FusionLord says:

I would personally say that it is worth it.

Aardaerimus D'Aritonyss says:

Always good to see you around, ZetaWolf! 🙂 I’m glad I could get this out. I always feel bad for taking so long, but I’m glad they’re still helpful and appreciated.

Awesombobby says:

Just a quick little thing to say, an app that I use that is much easier to use is 001 engine. You should try it!

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!