Skip to content

Commit 5c89c99

Browse files
bors[bot]Adrijaned
andauthored
1879: Small fixes to the pong tutorial r=jojolepro,azriel91 a=Adrijaned ## Description Fixes amethyst#1873 ## Additions Only doc change ## Removals Only doc change ## Modifications Only doc change ## PR Checklist By placing an x in the boxes I certify that I have: - [x] Updated the content of the book if this PR would make the book outdated. - [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment. - [x] Added unit tests for new code added in this PR. - [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme. If this modified or created any rs files: Not applicable Co-authored-by: Adrijaned <[email protected]>
2 parents bb25076 + b75273e commit 5c89c99

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

book/src/pong-tutorial/pong-tutorial-01.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,13 @@ Then we call `.run()` on `game` which starts the game loop. The game will
199199
continue to run until our `SimpleState` returns `Trans::Quit`, or when all states
200200
have been popped off the state machine's stack.
201201

202-
Try compiling the code now. You should be able to see the application start, but nothing
202+
Now, try compiling the code.
203+
204+
> **Note:** Please note that when compiling the game for the first time, it may
205+
> take upwards an half an hour. Be assured, though, that subsequent builds of
206+
> the project will be faster.
207+
208+
You should be able to see the application start, but nothing
203209
will happen and your terminal will hang until you kill the process. This means that the
204210
core game loop is running in circles, and is awaiting tasks. Let's give it something
205211
to do by adding a renderer!
@@ -254,8 +260,8 @@ Those plugins will equip our renderer with the ability to open a window and draw
254260

255261
In this configuration, our window will have a black background.
256262
If you want to use a different color, you can tweak the RGBA
257-
values inside `with_clear`. Values range from `0.0` to `1.0`, to get that cool green color
258-
you can try `[0.00196, 0.23726, 0.21765, 1.0]`.
263+
values inside `with_clear`. Values range from `0.0` to `1.0`, try using for
264+
instance `[0.00196, 0.23726, 0.21765, 1.0]` to get a nice cyan-colored window.
259265

260266
> **Note:** This setup code is using Amethyst's `RenderPlugin` trait based system that
261267
> uses `rendy` crate to define the rendering. If you plan to go beyond the rendering

book/src/pong-tutorial/pong-tutorial-02.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ initialization code from the Pong code.
4848
use crate::pong::Pong;
4949
```
5050
51-
4. Run `cargo build` to get the Rust compiler to complain about unused
52-
imports in `main.rs`, and delete these.
53-
5451
## Get around the World
5552
5653
First, in `pong.rs`, let's add a new method to our `State` implementation: `on_start`.
@@ -159,7 +156,7 @@ Now that our camera is set up, it's time to add the paddles.
159156
160157
## Our first Component
161158
162-
In this section, you will create the `Paddle` component. The code in this section should go into `pong.rs`.
159+
Now, we will create the `Paddle` component, all in `pong.rs`.
163160
164161
1. Define constants for the paddle width and height.
165162
@@ -518,6 +515,12 @@ are on the sheet. Let's create, right next to it, a file called
518515
)
519516
```
520517

518+
> **Note:** Make sure to pay attention to the kind of parentheses in the ron file.
519+
> Especially, if you are used to writing JSON or similar format files, you might
520+
> be tempted to use curly braces there; that will however lead to very
521+
> hard-to-debug errors, especially since amethyst will not warn you about that
522+
> when compiling.
523+
521524
Finally, we load the file containing the position of each sprite on the sheet.
522525

523526
```rust,edition2018,no_run,noplaypen
35 Bytes
Loading

0 commit comments

Comments
 (0)