Everytime you create a new C# project with Get It you need to run some commands to setup the project. This will be the same procedure everytime. So while you can copy and paste the following instructions, I find it better to type them by hand. After setting up a few projects you won’t need the help anymore.
-
Open PowerShell or any other terminal and run the following commands to create a new C# project called
GetItStarted
, reference the latest stable version ofGetIt
and open the project with VSCode:dotnet new console -o GetItStarted cd .\GetItStarted dotnet add package GetIt dotnet restore code .
- Open
Program.cs
, addusing GetIt;
to the list ofusing
declarations at the top of the file and replaceConsole.WriteLine("Hello World!");
withGame.ShowSceneAndAddTurtle();
- Press F5 to launch the program and you should see a window with a turtle at its center.
- If VSCode asks you to select an environment, choose
.NET Core
.
- If VSCode asks you to select an environment, choose
Congratulations, you just created and ran a brand new C# program with Get It.
Program.cs
should now look like this:
using System;
using GetIt;
namespace GetItStarted
{
class Program
{
static void Main(string[] args)
{
Game.ShowSceneAndAddTurtle();
}
}
For the first few projects everything will happen inside the two innermost curly braces {
and }
.
There you’ll write all commands that should get executed when the program is started.