Skip to content

Commit

Permalink
Use our own name generator
Browse files Browse the repository at this point in the history
I am old and don't want to think about more than 150 pokemon.
  • Loading branch information
rparrett committed Aug 26, 2022
1 parent 00f695c commit 275fdb5
Show file tree
Hide file tree
Showing 6 changed files with 1,882 additions and 2 deletions.
37 changes: 37 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interpolation = "0.2"
serde_json = "*"
serde = "*"
ron = "0.8"
rand = "0.8"

# Fix flashing ClearColor on Mac/Chrome
[patch.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ The [leaderboard server](https://jornet.vleue.com/) was kindly provided by [mock
- [ ] (Stretch goal) Sticky patches on track
- [ ] (Stretch goal) Barrel roll trick
- [ ] (Stretch goal) Lava at bottom of map
- [ ] (Stretch goal) Use our own name generator for the leaderboard
- [X] (Stretch goal) Use our own name generator for the leaderboard
3 changes: 2 additions & 1 deletion src/leaderboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use bevy_jornet::{
use bevy_ui_navigation::prelude::*;

use crate::{
random_name::random_name,
settings::LeaderboardSetting,
ui::{buttons, BUTTON_TEXT, NORMAL_BUTTON, TITLE_TEXT},
GameAssets, GameState, RaceTime,
Expand Down Expand Up @@ -377,7 +378,7 @@ fn create_player(
leaderboard.as_player(player.clone());
} else {
info!("creating new player");
leaderboard.create_player(None);
leaderboard.create_player(Some(&random_name()));
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod countdown;
mod game_over;
mod leaderboard;
mod main_menu;
mod random_name;
mod save;
mod settings;
mod ui;
Expand Down
Loading

0 comments on commit 275fdb5

Please sign in to comment.