|
2 | 2 |
|
3 | 3 | Flying Ninja is a 2D side-scroller game where players interact with the flying ninja character using their keyboard's spacebar to move the ninja character up and down. The goal is to avoid the obstacles and obtain points for each obstacle you dodge. When the game ends, the user can add their score to the leaderboard.
|
4 | 4 |
|
5 |
| -This game's logic is written in [Rust](https://internetcomputer.org/docs/building-apps/developer-tools/cdks/rust/intro-to-rust), a primary programming language for developing canisters on ICP. |
6 |
| - |
7 | 5 | ## Deploying from ICP Ninja
|
8 | 6 |
|
9 | 7 | When viewing this project in ICP Ninja, you can deploy it directly to the mainnet for free by clicking "Deploy" in the upper right corner. Open this project in ICP Ninja:
|
10 | 8 |
|
11 | 9 | [](https://icp.ninja/i?g=https://github.com/dfinity/examples/rust/flying_ninja)
|
12 | 10 |
|
13 |
| -## Project structure |
14 |
| - |
15 |
| -The `/backend` folder contains the Rust smart contract: |
16 |
| - |
17 |
| -- `Cargo.toml`, which defines the crate that will form the backend |
18 |
| -- `lib.rs`, which contains the actual smart contract, and exports its interface |
19 |
| - |
20 |
| -The `/frontend` folder contains web assets for the application's user interface. The user interface is written using the React framework. |
| 11 | +## Build and deploy from the command-line |
21 | 12 |
|
22 |
| -## Editing files |
| 13 | +### 1. [Download and install the IC SDK.](https://internetcomputer.org/docs/building-apps/getting-started/install) |
23 | 14 |
|
24 |
| -To make adjustments to this project, you can edit any file that is unlocked. Then, redeploy your application to view your changes. |
| 15 | +### 2. Download your project from ICP Ninja using the 'Download files' button on the upper left corner, or [clone the GitHub examples repository.](https://github.com/dfinity/examples/) |
25 | 16 |
|
26 |
| -To edit files that are immutable in ICP Ninja, you can export the project to GitHub or download the project to your local environment using the "Download files" option. |
| 17 | +### 3. Navigate into the project's directory. |
27 | 18 |
|
28 |
| -## Build and deploy from the command-line |
| 19 | +### 4. Deploy the project to your local environment: |
29 | 20 |
|
30 |
| -To migrate your ICP Ninja project off of the web browser and develop it locally, follow these steps. These steps are necessary if you want to deploy this project for long-term, production use on the mainnet. |
| 21 | +``` |
| 22 | +dfx start --background --clean && dfx deploy |
| 23 | +``` |
31 | 24 |
|
32 |
| -### 1. Download your project from ICP Ninja using the 'Download files' button on the upper left corner under the pink ninja star icon. |
| 25 | +## Security considerations and best practices |
33 | 26 |
|
34 |
| -### 2. Open the `BUILD.md` file for further instructions. |
| 27 | +If you base your application on this example, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/building-apps/security/overview) for developing on ICP. This example may not implement all the best practices. |
0 commit comments