encompass-cs-docs/content/pong/draw_paddle/first_run.md

48 lines
1.7 KiB
Markdown
Raw Normal View History

2019-05-23 19:54:38 +00:00
---
title: "First Run"
date: 2019-05-23T12:21:05-07:00
weight: 20
---
2020-07-12 01:19:31 +00:00
If you are using VSCode, all we have to do now is run our build and run task.
2019-05-23 19:54:38 +00:00
2020-07-12 01:19:31 +00:00
Hit `Ctrl-Shift-B` (or `Cmd-Shift-B` on OSX) to bring up the Build Tasks window.
![Build Tasks window](/images/build_tasks.png)
There's a lot of options here so let's break it down a bit.
`Build` tasks simply build the program, but do not execute it.
`Run` tasks execute without building.
`Build & Run` tasks build and then execute.
`Framework` means that the game will execute using .NET Framework (or Mono if you are on OSX or Linux).
`Core` means that the game will execute using .NET Core.
FNA recommends developing and shipping using Framework/Mono, but I find the Core debugger to be pretty powerful, so I switch to Core sometimes when I have a tricky bug to track down.
`Debug` means that the game will build in Debug mode.
`Release` means that the game will build in Release mode.
Debug modes are typically larger and slower than `Release` builds, but they allow you to use powerful debugging tools.
When you are shipping your game you should always, always use `Release` mode.
Anyway, for our first run, let's select `Build & Run: Framework Debug`.
2019-05-23 19:54:38 +00:00
Exciting!! Let's see what happens...
![pong first run](/images/pong_first_run.png)
2020-07-12 01:19:31 +00:00
Look at that! Terrific.
2019-05-23 19:54:38 +00:00
2020-07-12 01:19:31 +00:00
Cornflower blue is a lovely color, but for authenticity we probably want the background to be black instead.
2019-05-23 19:54:38 +00:00
2020-07-12 01:19:31 +00:00
In the Draw method, change Color.CornflowerBlue to Color.Black:
```cs
GraphicsDevice.Clear(Color.Black);
2019-05-23 19:54:38 +00:00
```
![pong second run](/images/pong_second_run.png)
2020-07-12 01:19:31 +00:00
Thaaaaaaat's more like it. But it's pretty boring right now. Games need action! Let's move on and get this paddle moving.