Jump to content
  • Advertisement
Sign in to follow this  
Zyndrof

VB.net: How to continue on the journey from beginner to pro?

This topic is 4374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there! Now that I've finished reading my first book on Visual Basic.NET I'm looking for source code to take a look at and learn from. Projects of the size of Pong, Tic-Tac-Toe or maybe even Tetris or Snake. Besides that, even though the question has been asked before; any other projects of the same size that I could program to teach me use the techniques I've learnt? And more espacially; how to use object oriented programming in my projects? Finally, I would like book suggestions on how to continue in my journey to become a programmer. Right now, I think I would like to stick with VB.net. If I was to pick up another language like Java or C++ I would probably just stop for good ^^ I'm getting somewhere in VB and I would like to keep progressing and not start all over again. Thank you in advance!

Share this post


Link to post
Share on other sites
Advertisement
Hello,
If by vb.net you reffer to the 2003 edition then I don't think you chose the easiest thing. I would say to start with VB6, but it is a bit too old, and if you are looking to do more complex stuff, vb6 is not the best choice, however it is very easy to learn and understand.

A better option would be the new vb from the visual studio 2005. It is available to download for free from the microsoft website, and there are a bunch of video tutorials as well to get you started.

When you want to progress you should start with C. As programing goes, C is the best thing to know, as ALOT of programing languages out there are variations of the C syntax. A few examples are PHP, Java, C#, C++. I personaly like C# and I use the visual studio 2005 one. It works very well with directx as opposed to vb6 and it is much more simple to use than the .net previous version.

If you decide to go with visual studio 2005 then check out the video tutorials from the microsoft website, same place from where you can download vs2005.

As a first program to do, I would suggest to do a Paint program. This pretty much covers all there is about objects and such.

Share this post


Link to post
Share on other sites
Quote:
Original post by Zyndrof
Hi there!
Now that I've finished reading my first book on Visual Basic.NET I'm looking for source code to take a look at and learn from. Projects of the size of Pong, Tic-Tac-Toe or maybe even Tetris or Snake.

Why don't you attempt to create those games? [smile] You'll learn alot more than from just looking at someone elses source. If you don't think you have the building blocks yet to create these games, make something smaller or it could be a sign you didn't learn all too much from that book: Did it have exercises that you followed and also wrote yourself? Did you experiment with them?

Share this post


Link to post
Share on other sites
Quote:
Original post by EthanStorm
If by vb.net you reffer to the 2003 edition then I don't think you chose the easiest thing. I would say to start with VB6, but it is a bit too old, and if you are looking to do more complex stuff, vb6 is not the best choice, however it is very easy to learn and understand.
Although Visual Basic 6 is easier to learn, it cuts you off from much of what you should know today. Much of the .NET Framework and other things that you learn when using a CLI compliant language, like VB.NET, arn't an easy thing to get when using VB6. This doesn't mean that VB6 is a bad choice, it just means that by learning VB.NET, you can apply the knowledge you know to other CLI languages like C# or even Boo.

Quote:
Original post by EthanStorm
When you want to progress you should start with C. As programing goes, C is the best thing to know, as ALOT of programing languages out there are variations of the C syntax.
The language you choice doesn't really matter, what matters is the options available and what you should learn. I personally would recommend staying away from C if you want to learn C++. Going backwards from C++ to C is a better idea as it will keep you from picking up bad C habbits earlier on. One of the main advantages of using C++ is the ability to use concepts like object orientation and the amazing STL. Of course, I would still recommend staying as far away from C++ as one can when first starting out.

As I mentioned before, there are many other languages out there that teach you the concepts of how to program earlier on then if you were to learn through C or C++. Python, VB.NET, C#, etc are much better choices for beginners.

Quote:
Original post by EthanStorm
As a first program to do, I would suggest to do a Paint program. This pretty much covers all there is about objects and such.
A Paint program seems like a pretty complex project to me. You'd have to deal with:
  • Scope - How big can a paint program get? When will you stop programming? Will you stop when you have an MSPaint clone? GIMP?
  • GUI - One of the important things of a paint program is its GUI. GUI programming is an extremely complex issue to tackle and shouldn't be done if you don't know what you're doing.
  • Graphics - Drawing on the screen programatically is pretty complicated, let alone making the user draw on it for you. What other graphical tools will you have in your paint program?
Personally, I think taking on a paint program as a first project is a bad idea because of unbound scope and the complexity. Of course, you can attempt it if you want, but it's very easy to get overwhelmed when you're first starting out.

A good first project has a fixed scope and is extremely easy to implement. One such example is a hello world demo as you'll just get the first words on the screen. It really doesn't matter what language you use as instead of asking "How do I do this?", you'll be asking "What is this syntax in this language?".

As a second project, you can get some game mechanics going, while still keeping things simple. Tic Tac Toe introduces user input and game mechanics. It will also keep you motivated to move onto your next project: Pong. Pong gives you the ability to display realtime graphics on the screen. Once you have the ability to use graphics on the screen, you can then introduce some realitively complex game mechanics like Tetris. And everyone has to implement a Tetris clone [wink].

Share this post


Link to post
Share on other sites
It seems I made myself look like a Total beginner, which I'm not since I've read a pretty massive beginners book (about 800 pages).
I don't know about a paint program though, since the book created one in one of the chapters to introduce som graphics. Therefore I think I would use the book as a reference whenever something isn't working or whenever I don't know how to continue. That would lead to me not learning much.

I use VB2005 and intend to continue using it. I actually refuse to change language now ;) It took a long time to find a language I'm comfortable with and I won't trade it for at least a couple of months ^^

I would like to try building a Tic-Tac-Toe myself but I have no idea how to create the grid on which you play. After that I don't think it would be to much of a problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by Zyndrof
I would like to try building a Tic-Tac-Toe myself but I have no idea how to create the grid on which you play. After that I don't think it would be to much of a problem.

Alright then - problem solving is probably the most important skill for a programmer, so why don't we have a think about this problem and see if you can come up with a solution?

You need to figure out how your program is going to store the play-area internally, you need to figure out how you're going to display it to the player, and you need to figure out how the player is going to interact with it.

A quick ASCII diagram of a tic-tac-toe board:

X| |
-+-+-
|O|
-+-+-
| |


So, how could you respresent that programatically? The play area is a 2 dimensional grid measuring 3x3, and each square can have one of three states (unoccupied, X, or O).

How could you display it graphically? Are you going to be drawing your own client area, or using WinForms - it could be as simple as selecting an appropriate control, or you might want to draw your own custom interface.

How could you handle input? If you've gone the WinForms route then the control you've selected to display each cell may provide you with the options you need to control this. If you're looking for a simple keyboard input method, you could consider the keys on the numpad. If you're drawing your own interface and want to use the mouse you might need to figure out how you could find out where the user has clicked.


So with a couple of hints there do you have any thoughts on how you could solve any of those problems?

Share this post


Link to post
Share on other sites
Quote:
Original post by Demosthenes
I've made a tic tac toe program a while ago in vb .net - help yourself


You're not actually helping.

I know you mean well, but you're not. Problem solving is the number one skill for programming. You'll have to develop the skill at some point to be even moderately competant. It is a crime to throw slabs of code at newbies facing problems and say "oh, look how I did it". You may have done it well, you may have done it elegantly, hell, you may have turned your source-code into a tutorial, but then, that's the point - you have done it. If the newbie reads your code and goes "oh, so that's how I should have done it", that's one less opportunity for them to work it out by themselves. One less opportunity to make mistakes and correct them, thus learning the pitfalls (they can't see the code you've deleted and rewritten, can they) and avoiding them, one less opportunity to excerise their brain in the vital stage of "now how the hell am I going to approach this problem?". That's a really important stage.

Think about it: A very common newbish question is "How do I make a game?", or "How do I make an FPS game?". Obviously, there's no receipe book for games. A better question could be "How do I make this game?", and list a billion requirements (an SRS document would be great!). Likewise, newbies must ask themselves questions such as "How do I solve this segmentation fault?", rather than look at your code and think "oh, if I code like him, I won't have any".

Wow man, that turned out to be really long!

Zyndrof: I would go for Pong. It has everything you need: Graphics, User Input, AI, Physics, the works. And it's pretty easy too.

Hope that helps.

Share this post


Link to post
Share on other sites
Thank you all... I will try figuruíng out how to make Tic-Tac-Toe and Pong.
About Tic-Tac-Toe: The problem for me is not how to use the grid, but to make the grid. There are probably a few different solutions to this. For example; there may be a control in VS 2005 that I can use to make it easy for me OR I have to create the grid myself somehow using lines and creating invisible squares inside them, then checking if the user interacted with the square, in that case, whose turn was it?

Is there a control for this?

Share this post


Link to post
Share on other sites
An easy solution would be make a 2d-array containing some tile info and drawing the tiles as bitmap images. You apply all the logic to the 2d-array and reflect that logic in the bitmap images.

Good Luck,
Jeroen

Share this post


Link to post
Share on other sites
Quote:
Original post by Zyndrof
About Tic-Tac-Toe: The problem for me is not how to use the grid, but to make the grid. There are probably a few different solutions to this. For example; there may be a control in VS 2005 that I can use to make it easy for me OR I have to create the grid myself somehow using lines and creating invisible squares inside them, then checking if the user interacted with the square, in that case, whose turn was it?

Is there a control for this?

You could use 9 button controls, and change the text when they're clicked. You could do the same thing with picturebox controls, but loading a different image.

If you're drawing it yourself you'd be capturing the click events to the form itself (or to some sort of container on the form).

You could possibly represent the play area in memory as a 2d array.


Tic-tac-toe is a two player game - so you could simply store either a 1 or a 2 in an integer to keep track of who's turn it is; every time someone makes a move it changes to the other person's turn.


There are plenty of other solutions as well, but those are a couple of thoughts that might give you a starting point.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!