Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Aug 9, 2024
1 parent 256fb3b commit a41e54c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions docs/chapters/add_player_sprite_with_texture.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This chapter introduces:

## 2.5.1. First tests

Our first tests are the same as earlier chapters,
Our first tests are the same as in earlier chapters,
forcing us to write `create_app`, `count_n_players` and
the `Player` component:

Expand All @@ -37,11 +37,29 @@ fn test_our_app_has_a_player() {
}
```

The previous chapter discusses these steps in details.
See the ['Add a player'](add_player.md) chapter for the implementations
and an in-depth discussion.

## 2.5.2. Third test: our player has a default scale

The image will be displayed at its original 1:1 scale:
In [the 'Add a player sprite' chapter](add_player_sprite.md)
the size of the player's sprite was set to its
size (i.e width and height) in pixels, using
the `scale` of a player's `Transform`. In that context,
`scale` is a misnomer: it indicates the size of the player (and not the
scale).

Check failure on line 50 in docs/chapters/add_player_sprite_with_texture.md

View workflow job for this annotation

GitHub Actions / check_markdown

Trailing spaces [Expected: 0 or 2; Actual: 1]

When using an image, 'scale' is nicely named: an image
has its inherent size in pixels, where `scale`
will scale the image up or down. When the scale is set to one,
an image will be displayed at its original 1:1 scale.
In Bevy, a scale has three dimensions.

Here we test that the scale of our image is one in both two

Check failure on line 58 in docs/chapters/add_player_sprite_with_texture.md

View workflow job for this annotation

GitHub Actions / check_markdown

Trailing spaces [Expected: 0 or 2; Actual: 1]
dimensions, as we are working on as 2D game. We will later assert
that the scale in the third dimension is one too.

Check failure on line 60 in docs/chapters/add_player_sprite_with_texture.md

View workflow job for this annotation

GitHub Actions / check_markdown

Trailing spaces [Expected: 0 or 2; Actual: 1]

Here is the test:

```rust
fn test_player_has_the_default_scale() {
Expand Down

0 comments on commit a41e54c

Please sign in to comment.