Visual Basic Game Programming for Teens, 2nd Edition

Aug 12, 2007

VB for Teens, 2E is finished and should be available in stores by October. The screenshot image here shows the final version of the game as presented in the last chapter of the book. The final content took quite a different direction than I had originally planned. This new edition includes a complete chapter introducing the beginner to VB.NET programming, and another whole chapter just on the basics of Managed DirectX. We then quickly delve into the Celtic Crusader game engine and begin building the game, step by step, chapter by chapter. Although I’d wanted to include projectile weapons and questing, the game became more of a hack-n-slash like Diablo.

celtic_crusader.pngImprovements over the previous version include linked lists of characters and inanimate objects in the game world, making it very easy for you to add new items to the game world. The game world is more detailed now as well, with roads connecting most of the major towns. A list of towns is maintained in a Locations list in memory so the game will tell you when you’ve entered a town. Shortcut keys (F1-F10) let you teleport to the major towns while exploring (a testing feature), although you could use this technique to allow the player to teleport to a town center, then return. Due to the object oriented nature of VB.NET, the game is much more modular than it’s prior version allowed in VB6.

I was literally exhausted upon completing Chapter 17 and could not work on the final two chapters previously planned. I was very disappointed, but due to the book’s deadline and my stress level I had to find a good point to end the project and gracefully complete work on the game. The result is a far more customizable game engine than in the previous edition. I am very fond of Celtic Crusader and look forward to what others will do with it.

Chapter 1: Getting Started
Chapter 2: Introduction to Visual Basic .NET
Chapter 3: Introduction to Managed DirectX
Chapter 4: Sprites: The Key To 2D Games
Chapter 5: Printing Text and Getting User Input
Chapter 6: Tile-Based Scrolling
Chapter 7: Entity Management
Chapter 8: Playing Sound Effects and Music
Chapter 9: Designing The Celtic Crusader Game
Chapter 10: Creating The Game World
Chapter 11: Exploring The Game World
Chapter 12: Adding Scenery and Objects
Chapter 13: Creating The Player Character
Chapter 14: Building The Celtic Crusader Engine
Chapter 15: Keeping Track of Inventory
Chapter 16: Adding NPCs and Monsters
Chapter 17: Engaging in Combat

The last two chapters as planned…

Chapter 18: Ranged Combat: Arrows and Spells
Chapter 19: Gaining Experience and Leveling Up

had to be axed. I also had to cut two other chapters in order to keep within the confines of the for Teens series (350 pages max). I’d wanted to add a questing system to the game, where you have to go somewhere and find an artifact, then give it to someone to get special gear. Basically, a key/door system, which is simple but would have been fun. The game has a linked list of items; it will be easy to implement this type of questing system into the game. This is a solid RPG engine, but it’s only a start as there are many more features that can be added in time.

The C# port of the game proved too time consuming because all of the map loading code had to be rewritten, from the basic VB file I/O to C# streams, and there was insufficient time to get it done in time to include on the CD-ROM. I will post the C# version of the game here on my web site when time permits.

Posted by Jonathan Harbour | Categories: News |

Share with others

28 Responses so far | Have Your Say!

  1. grapthaur
    August 17th, 2007 at 11:23 am #

    The layout of the material covered in Visual Basic Game Programming for Teens, 2nd Edition, appears fairly robust, however, I would encourage the author to include the neglected chapters at another location. For example, including them as text files on a resource CD would be excellant, or perhaps as a downloadable file under resources for the authored books would be satisfactory.

  2. javalot
    August 21st, 2007 at 9:59 am #

    I bought your book, beginning Java 5 second edition and tried to install Jbuilder 2006. It needed a key or file, and the CD and book do not have anything to say about it. I downloaded Jbuilder 2007, and it was totally different than the stuff in the book. I cant find 2005 or 2006 anywhere. Please tell me the key or the file.

  3. Mobidoy
    August 22nd, 2007 at 9:53 am #

    I am looking forward to this book, i am a big fan of RPG and, always wanted to create one. I was looking for a tutorial to create one when i came across your VB6.0 version.

    I am counting days till it will come out. My son (wich love to create stories, npc, monster, weapon etc… is really excited about it too :)

    Only 51 days left :)

  4. Mobidoy
    August 23rd, 2007 at 5:35 am #

    I am looking forward to this book, i already pre ordered it. I am learning programmation and, always been a fan of RPG. I always wanted to create one for me and my son. He is the one that give me all the idea (monsters, weapon, quests, storyline, etc…)

    Cant believe its still a month and half till i can start on it :)

    Great job Jonathan.
    (actually going thru the VB6 book)

  5. Jonathan Harbour
    August 23rd, 2007 at 9:58 am #

    Okay, I simply ran out of time on the deadline for this book, as well as running into the page count issue, but I really want to see those axed chapters finished. I will see what I can do over the next two months. Maybe I will have time to finish the ranged combat and quest system although the plan all along was to create an RPG engine, not a complete game.

  6. Devon
    August 26th, 2007 at 12:04 pm #

    What Sprite Animator Are you using Now?

    Just Wanted to know!

  7. Jonathan Harbour
    August 27th, 2007 at 8:47 pm #

    I use GIMP, Mappy, and Pro Motion in this book for all of the artwork. Mini tutorials are included on the basics of creating sprite sheets and this new edition uses alpha channel PNG images rather than color-keyed BMPs.

  8. daviangel
    September 13th, 2007 at 3:08 pm #

    Maybe if you cannot get them extra chapters online you can put them in a future book that covers VB and XNA since Managed DX is being replaced by XNA by Microsoft?

  9. Jonathan Harbour
    September 14th, 2007 at 7:05 am #

    Anything is possible. :) Managed DirectX will never go away because it’s part of the .NET Framework. XNA has good and bad aspects and some programmers do not want a game framework but prefer to create their own.

  10. Charles256
    October 7th, 2007 at 6:19 pm #

    Do the examples and the game run under windows vista? Just realized today your original book examples do not appear to run under vista. :(

  11. Jonathan Harbour
    October 7th, 2007 at 11:01 pm #

    Hmm…. I don’t use beta versions of operating systems (which is what Vista is, whether you believe it or agree with me or not, it’s still beta…). I believe if you can get Visual Basic 2005 to run on your Vista system (good luck with that…btw) you are good to go with all of the code from the book.

  12. uchuugaka
    October 14th, 2007 at 12:59 pm #

    Bought this book, but haven’t had time to do much with it yet. Certainly seems promising though.
    Learning VB enough to use the book isn’t hard, if you have experience with other languages, but I do kinda question the choice of VB.

    Anyway, just wondering if there are any alternatives to Mappy for other OS’s (linux, OS X)

    I ultimately want to take what’s in the book and do the same in Ruby.

    BTW, I have your Game Programming All in One 3rd Ed, and let me tell you, it’s pretty nice, though heavy. I’m liking Allegro, aside from the pain of getting it installed…

  13. Kash
    October 15th, 2007 at 8:53 pm #

    Hey I checked out your “Visual Basic Programming for Teens” Book, and I can’t find visual basic 6.0. Could you send me the program, or tell me where to find one? If its impossible to get, can you tell me what language would be exactly the same? thanks.

  14. Jonathan Harbour
    October 16th, 2007 at 9:20 am #

    Hi Kash. Visual Basic 6.0 is hard to find these days. If you don’t have any luck finding it, all I can really suggest is to pick up the 2nd Edition which uses the free VB 2005 compiler. The sources for this book will be available for download here soon.

  15. ronaldr32
    October 17th, 2007 at 7:30 am #

    I might be early on this question. I just got your Visual Basic game programming for Teens 2nd edition yesterday. In it you mentioned that there was C# code that was available for download on your site or the CoursePTR site. I have tried to find it but I can’t locate it anywhere. Am I missing something or has the links not been added to the sites yet?

  16. ronaldr32
    October 17th, 2007 at 7:33 am #

    I am sorry. I didn’t read the last line on you web page. I try not to do this but I goofed. I really like your book.

  17. Jonathan Harbour
    October 17th, 2007 at 8:11 am #

    I have actually converted most of the classes to C#, it’s just the file I/O code that must be totally rewritten. This is a result of using VB-specific code rather than a streamreader, in the interest of time. If I’d used “proper” .NET file I/O, this would have been a very quick and easy conversion to C#. I’ll work on the full C# version of Celtic Crusader as soon as I can. It will be located on the “Books” link where the other source codes are listed, but I can’t promise a date.

  18. daviangel
    October 21st, 2007 at 6:03 pm #

    “Do the examples and the game run under windows vista? Just realized today your original book examples do not appear to run under vista.”

    Well I just got the book and am running Vista 64 bits and yeah unless you recompile them they all crash.
    As long as you have VB express though it’s pretty easy to fix. All you need to do is change exectuable type from drop down box next where the green run button on the menu is to x86 instead of anycpu!
    p.s. the viewmap program off the new cd won’t run either since for some reason ireland.map file is 0 bytes(took me while to figure that one out!) so just copy it from another chapter to get it to work.

  19. Jonathan Harbour
    October 22nd, 2007 at 1:27 pm #

    Hi Daviangel. It’s not a matter of whether the book’s code will run under Vista, it’s an issue of whether Visual Studio runs under Vista. I believe VS 2005 SP1 works on Vista 32-bit. If you’re eager to waste many hours of your time on stupid O/S problems, then the 64-bit version will appeal to you. It does not appeal to me, so I haven’t tried it, and do not intend to ever use Vista 64.

  20. mouzers
    October 27th, 2007 at 11:30 am #

    hey johnathon i read your first book it was confusing so i couldnt do it… am i able to make this one if i have no programming experience?

  21. TEA
    October 27th, 2007 at 1:11 pm #

    I have to say, I was very disappointed with the book entirely. To me, It looked like you did alot of “cut and paste” from your last book and the most difficult part was the source codes — and still (even as a beginner) I seen a few ’subjects’ that could of been deleted so that other, real subjects could have been added in. I bought the book hoping that you put the source code and/or example of long ranged attacks (arrows, guns, etc.) but you didn’t.

  22. Jonathan Harbour
    October 27th, 2007 at 5:53 pm #

    Yeah, I know what you mean, TEA. I wanted to recreate Ultima VII: The Black Gate, but couldn’t squeeze it into 350 pages so I had to do Celtic Crusader instead.

  23. Undeadbobop
    December 23rd, 2007 at 11:02 pm #

    Hey I have had many problems With the “Select case Statements” And I need someone to help me find out how to do it right I have read the part so many many times and it never works every time I try and when it does it is always picking the Else which is not what I want it to do when the other statement is true which as been proven with the If..Then..else Statement
    Select Case (String3)
    Case String3 = String1
    Console.WriteLine(”Action01 is True”)
    Case String3 = String2
    Console.WriteLine(”Action02 Is True”)
    Console.WriteLine(”MultiLine Action Is true”)
    Case Else
    Console.WriteLine(”You have failed”)
    End Select

  24. Undeadbobop
    December 23rd, 2007 at 11:45 pm #

    I am Having Trouble Runing any examples past the if…then..else statements in the visual basic 2008 and the links in your book are some what out of date and only link to trails and newer versons that do in fact not match up with many new forms of programing such as vb 2008 which I can not find a place where I can get 2005 I can only find 2008 which gives me alot of trouble because they made it harder to do anything in 2008 I hate it and I have the advance verson due to the fact that the lowest verson does not have the ablitity to run on a xp 64 bit Nothing ever does I have no idea why 64 bit runs so much more smoother then 32 and fixes it self much nicer when their is a problem and runs everything much faster….

  25. Jonathan Harbour
    April 21st, 2008 at 7:48 am #

    This book was not written for beginners. If you don’t know Visual Basic, go read a beginner’s book first, spend about a year writing VB code, then come back to Celtic Crusader.

  26. lavendalla
    October 13th, 2008 at 5:49 pm #

    I am trying to write a RPG with a friend and I have read this book once. I went back to read it again, about 6 months later, and realized that I had lost the CD. A download link would be appreciated. I will give any info, other than personal info, to prove that I own the book.

    Thanks,
    Lavendalla

  27. LeonBlade
    October 14th, 2008 at 2:11 pm #

    I really like this book!

    We are using it in my BOCES Computer Programming class, well, me and two of my other friends.

    The rest of the class is doing the beginner stuff, but I already know Visual Basic, so does my friend, and my other friend caught on fast.

    Right now I just got done with Chapter 4 with the sprites. I can’t get the tavern on the screen for some reason however.

    So far this book is really good, can’t wait to finish Celtic Crusader and edit some stuff around and see what I can do.

  28. knightofdespair
    May 5th, 2009 at 8:51 am #

    Not sure if you are still following this thread or not…

    I am using the vb6.0 version, although I have background in a few other languages.

    I am having a heck of a time getting other maps to load. I can get them to load fine in mappy, as far as I can tell they are the same settings. It is quite a bit smaller as I was going to use say several dozen maps instead of one huge one, the problem I have is it will ‘load’ but everything is messed up. I tried doing a simple grass only map and it only loads as solid black. I can’t tell if its a problem with the code or the loader, or a mappy issue… I tried resaving your original and it loads. Scratching my head, not sure what else to try next.