Skip to content

Commit 74c914a

Browse files
committed
cargo fmt
1 parent a635227 commit 74c914a

File tree

3 files changed

+3
-107
lines changed

3 files changed

+3
-107
lines changed

README.md

Lines changed: 1 addition & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1 @@
1-
# A Bevy game template
2-
3-
Template for a Game using the awesome [Bevy engine][bevy] featuring out of the box builds for Windows, Linux, macOS, Web (Wasm), Android, and iOS.
4-
5-
# What does this template give you?
6-
7-
* small example ["game"](https://niklasei.github.io/bevy_game_template/)
8-
* easy setup for running the web build using [trunk] (`trunk serve`)
9-
* run the native version with `cargo run`
10-
* workflow for GitHub actions creating releases for Windows, Linux, macOS, and Web (Wasm) ready for distribution
11-
* the same workflow creates development builds for the mobile platforms (two separate workflows can push to the stores after [some setup](#deploy-mobile-platforms))
12-
* push a tag in the form of `v[0-9]+.[0-9]+.[0-9]+*` (e.g. `v1.1.42`) to trigger the flow
13-
* CI workflow that checks your application on all native platforms on every push
14-
15-
WARNING: if you work in a private repository, please be aware that macOS and Windows runners cost more build minutes.
16-
**For public repositories the workflow runners are free!**
17-
18-
# How to use this template?
19-
20-
1. Click "Use this template" on the repository's page
21-
2. Look for `ToDo` to use your own game name everywhere
22-
3. [Update the icons as described below](#updating-the-icons)
23-
4. Start coding :tada:
24-
* Start the native app: `cargo run`
25-
* Start the web build: `trunk serve`
26-
* requires [trunk]: `cargo install --locked trunk`
27-
* requires `wasm32-unknown-unknown` target: `rustup target add wasm32-unknown-unknown`
28-
* this will serve your app on `8080` and automatically rebuild + reload it after code changes
29-
* Start the android app: `cargo apk run -p mobile`
30-
* requires following the instructions in the [bevy example readme for android setup][android-instructions]
31-
* Start the iOS app (see the [bevy example readme for ios setup instructions][ios-instructions])
32-
* Install Xcode through the app store
33-
* Launch Xcode and install the iOS simulator (check the box upon first start, or install it through `Preferences > Platforms` later)
34-
* Install the iOS and iOS simulator Rust targets with `rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim`
35-
* run `make run` inside the `/mobile` directory
36-
37-
You should keep the `credits` directory up to date. The release workflow automatically includes the directory in every build.
38-
39-
### Updating the icons
40-
1. Replace `build/macos/icon_1024x1024.png` with a `1024` times `1024` pixel png icon and run `create_icns.sh` or `create_icns_linux.sh` if you use linux (make sure to run the script inside the `build/macos` directory) - _Note: `create_icns.sh` requires a mac, and `create_icns_linux.sh` requires imagemagick and png2icns_
41-
2. Replace `build/windows/icon.ico` (used for windows executable and as favicon for the web-builds)
42-
* You can create an `.ico` file for windows by following these steps:
43-
1. Open `macos/AppIcon.iconset/icon_256x256.png` in [Gimp](https://www.gimp.org/downloads/)
44-
2. Select the `File > Export As` menu item.
45-
3. Change the file extension to `.ico` (or click `Select File Type (By Extension)` and select `Microsoft Windows Icon`)
46-
4. Save as `build/windows/icon.ico`
47-
3. Replace `build/android/res/mipmap-mdpi/icon.png` with `macos/AppIcon.iconset/icon_256x256.png`, but rename it to `icon.png`
48-
49-
### Deploy web build to GitHub pages
50-
51-
1. Trigger the `deploy-github-page` workflow
52-
2. Activate [GitHub pages](https://pages.github.com/) for your repository
53-
1. Source from the `gh-pages` branch (created by the just executed action)
54-
3. After a few minutes your game is live at `http://username.github.io/repository`
55-
56-
To deploy newer versions, just run the `deploy-github-page` workflow again.
57-
58-
# Deploy mobile platforms
59-
60-
For general info on mobile support, you can take a look at [one of my blog posts about mobile development with Bevy][mobile_dev_with_bevy_2] which is relevant to the current setup.
61-
62-
## Android
63-
64-
Currently, `cargo-apk` is used to run the development app. But APKs can no longer be published in the store and `cargo-apk` cannot produce the required AAB. This is why there is setup for two android related tools. In [`mobile/Cargo.toml`](./mobile/Cargo.toml), the `package.metadata.android` section configures `cargo-apk` while [`mobile/manifest.yaml`](./mobile/manifest.yaml) configures a custom fork of `xbuild` which is used in the `release-android-google-play` workflow to create an AAB.
65-
66-
There is a [post about how to set up the android release workflow][workflow_bevy_android] on my blog.
67-
68-
## iOS
69-
70-
The setup is pretty much what Bevy does for the mobile example.
71-
72-
There is a [post about how to set up the iOS release workflow][workflow_bevy_ios] on my blog.
73-
74-
# Removing mobile platforms
75-
76-
If you don't want to target Android or iOS, you can just delete the `/mobile`, `/build/android`, and `/build/ios` directories.
77-
Then delete the `[workspace]` section from `Cargo.toml`.
78-
79-
# Getting started with Bevy
80-
81-
You should check out the Bevy website for [links to resources][bevy-learn] and the [Bevy Cheat Book] for a bunch of helpful documentation and examples. I can also recommend the [official Bevy Discord server][bevy-discord] for keeping up to date with the development and getting help from other Bevy users.
82-
83-
# Known issues
84-
85-
Audio in web-builds can have issues in some browsers. This seems to be a general performance issue and not due to the audio itself (see [bevy_kira_audio/#9][firefox-sound-issue]).
86-
87-
# License
88-
89-
This project is licensed under [CC0 1.0 Universal](LICENSE) except some content of `assets` and the Bevy icons in the `build` directory (see [Credits](credits/CREDITS.md)). Go crazy and feel free to show me whatever you build with this ([@nikl_me][nikl-twitter] / [@nikl_me@mastodon.online][nikl-mastodon] ).
90-
91-
[bevy]: https://bevyengine.org/
92-
[bevy-learn]: https://bevyengine.org/learn/
93-
[bevy-discord]: https://discord.gg/bevy
94-
[nikl-twitter]: https://twitter.com/nikl_me
95-
[nikl-mastodon]: https://mastodon.online/@nikl_me
96-
[firefox-sound-issue]: https://github.com/NiklasEi/bevy_kira_audio/issues/9
97-
[Bevy Cheat Book]: https://bevy-cheatbook.github.io/introduction.html
98-
[trunk]: https://trunkrs.dev/
99-
[android-instructions]: https://github.com/bevyengine/bevy/blob/latest/examples/README.md#setup
100-
[ios-instructions]: https://github.com/bevyengine/bevy/blob/latest/examples/README.md#setup-1
101-
[mobile_dev_with_bevy_2]: https://www.nikl.me/blog/2023/notes_on_mobile_development_with_bevy_2/
102-
[workflow_bevy_android]: https://www.nikl.me/blog/2023/github_workflow_to_publish_android_app/
103-
[workflow_bevy_ios]: https://www.nikl.me/blog/2023/github_workflow_to_publish_ios_app/
1+
# A nyt sudoku game clone

src/game/cell_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bevy::prelude::*;
2-
use std::ops::BitXorAssign;
32
use bevy::utils::HashSet;
3+
use std::ops::BitXorAssign;
44
use sudoku::bitset::Set;
55
use sudoku::board::{CellState, Digit};
66

@@ -153,4 +153,4 @@ pub struct CorrectionCell;
153153

154154
/// 选中的格子
155155
#[derive(Component)]
156-
pub struct SelectedCell;
156+
pub struct SelectedCell;

src/loading.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ impl Plugin for LoadingPlugin {
2020
}
2121
}
2222

23-
2423
// the following asset collections will be loaded during the State `GameState::Loading`
2524
// when done loading, they will be inserted as resources (see <https://github.com/NiklasEi/bevy_asset_loader>)
2625

@@ -62,7 +61,6 @@ pub struct TextureAssets {
6261
pub correction: Handle<Image>,
6362
#[asset(path = "textures/congrats-star.png")]
6463
pub congrats_star: Handle<Image>,
65-
6664
}
6765

6866
#[derive(AssetCollection, Resource)]

0 commit comments

Comments
 (0)