Before you start using Visual Studio, you should get familiar with the different parts of it.
Here is what Visual Studio will look like after you start building your game.
Menu
Just like many programs, the menu options are at the top. The ones you’ll use most often are:
- File – To open your solution, and start working on it.
- Save – Save the current file you’re working on.
- Save All – Save all changes in the current solution you’re working on.
- Build – This “compiles” your solution – converts it from C# code to code that the computer can understand. This will also tell you if there are any problems in your solution.
- Start – This builds (compiles) your program and runs it – so you can actually use it.
Solution Explorer
This section shows all the projects in your solution and all the files in the projects.
This is where you will add files to your projects, rename or move existing files, and (sometimes) delete files from your project.
- The SuperAdventure Solution – The top level grouping of your program/application.
- Engine project – Where we will put the “logic” of the program.
- SuperAdventure project – Where we will put the screen/display part of the program.
Properties
When you’re working with the parts of the game that appear on the screen – from the main form to the individual buttons and boxes on it – the Properties section will show you things you change about your currently selected object.
For instance, you can set the height and width of a form. You can set the words you want displayed on a button. You can set whether or not something is visible.
We’ll set some properties for the objects we create from this section of Visual Studio. Some others will be set from other places inside the program.
Output
When you build, or run, your program, this is where you’ll receive status messages.
If everything is OK, you see that everything succeeded. If there were any problems, you’ll see where they are, so you can go fix them.
Toolbox
Just like the “Properties” section, the Toolbox area is filled when you’re currently working on the parts of your program that are displayed on the screen.
This section shows you all the things you can add to the forms in your program – buttons, labels (text), checkboxes, radio buttons, etc. You can select what you want to add to the form and drag it to the place where you want it located on your form. You might hear this called “drag-and-drop” programming.
Workspace
This is the space where you actually work on a part of your program.
You select what you want to work on, from the Solution Explorer, and work on it here. You can have several files open on your workspace at one time (see the tabs at the top of the workspace), but you’ll only have one “on top”, that you’re actually working on at the moment.
Next Lesson: Lesson 01.1 – Defining classes and objects for the game
Previous lesson: Lesson 00.2 – General information about programming in C#
All lessons: Learn C# by Building a Simple RPG Index
Oh, hi! I use Visual Studio Code, that is for linux.
I don’t know if the vistual Studio for microsoft is different, but I would like to know if it works the same way or it would have a bit of extra work.
If I have to do a bit of extra work, it does not matter for me
I never tried this in Linux. If you can create a Windows Form project, and can use LINQ, then this will probably work. I will look for more information about this.
Yes I use vs code for C# and yes you can make it run C# I currently am using a mac but the processes are relatively similar because the mac terminal uses bash too. I recommend watching a youtube video (https://www.youtube.com/watch?v=CO4BGZOuUkM) This is relatively similar to the process on Linux! (I hope this helped)
Hey, Scott! I want to go through your tutorial, but I don’t feel like downloading 9GB of data VS offers me. Will it be difficult for me to follow this guide while using SharpDevelop instead? It is really lightweight, I won’t have to wait before I can start learning. Thank you in advance!
Hello Gena. I watched some videos of people using SharpDevelop, and it looks like you will be able to use it. The only things I can think of to be careful of:
1. When you create the SuperAdventure (Windows Form) project, please name it SuperAdventure. Some people use a different name. If you do that, you need to change the project’s namespace, and I do not know where to do that in SharpDevelop.
2. I do not know exactly how SharpDevelop creates eventhandlers. In Lesson 03.1, you double-click on a button on the game’s form, to create a (hidden) eventhandler and a function. SharpDevelop probably does this the same as Visual Studio, but I am not sure. Let me know if you get to that lesson and it does not work.
3. After each lesson, compile and run the program. If you see a problem, and you cannot fix it yourself, please leave a comment. I will try to help you fix the problem.
Thank you very much! I will let you know whether it will work the same with SharpDevelop or not, as I get to that lesson. Thank you very much for you support!
I too am using Sharpdevelop. Looking forward to the tutorial. I hope it works in Sharpdevelop.
Cool. Please let me know if you encounter any problems.
Hi, Scott.
Hope you’re well.
I would like some advice.
I want to learn how to develop applications with Visual Studio using C# (WPF/WPA/Xamarin and xaml through Xamarin.forms, etc. “everything in other words”)
should I learn everything about C# first, like all the syntax for a year or so with books like C# All in One for Dummies etc? Then move onto Udemy courses specific to Xamarin and Xaml etc with Visual Studio?
What is your advice?
Thank you, in advance.
Omair
Hello Omair,
I suggest learning the basics of C#, using Windows Form projects, or Console projects. Those are the simplest front-ends (user interfaces). You wouldn’t need to know everything about C#. But, you would want to be able to create simple programs, and be familiar with Object-Oriented Programming principles.
After learning the basics, I would work on the different types of front-ends. If you follow these lessons up to Lesson 23.1, you’ll see how you can put your program’s logic in a Class Library project, and have different front-ends. That would let you experiment with ASP.NET, WPF, etc. – without needing to write a completely new program for each type of UI.
this is pretty neat tytytytytytytytytytyty <3
You’re welcome 🙂
Wow thank you very much! This is a helpful tutorial for our computer science 30 class!
You’re welcome!
Hi, I hope this isn’t a too stupid question, but do we use VS Code or VS?
This is using the full Visual Studio (Community Edition works). I have not tested this with VS Code.
Thanks for the fast response.
I use visual studios for Microsoft and all i see on it is the work space and menu. that is it. please help.
Can you send a screenshot of what you see when you start Visual Studio? And, which version of Visual Studio did you install?
BROOOOOOO! YOU ARE AMAZING! I’m working on a similar project, and this is ay godsend.
Thanks!
do i click on game development when i download the visual studios?
Hi Xander,
You don’t need to download the “Game development” tools. I believe those are for Unity programs, and we do not use Unity for this game.
You should only need the “.NET desktop development” components. Check that the “.NET Framework” versions are selected (you may need to click on the “Individual Components” link at the top of the screen, to select them). It’s OK if you install the newer versions of .NET Framework (4.7 and 4.8)
When you create the projects for the game, make sure you create the “.NET Framework” projects, not the “.NET Core” or “.NET Standard”. Those other versions of .NET handle graphics a different way.
Let me know if that is not clear, or if you have any other questions.
Hi there,
I wanted to point out that where you said “You might here this called “drag-and-drop” programming.”, I believe you meant “hear”.
Thanks for letting me know. I fixed it.