Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 0.13 template #98

Merged
merged 3 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/0.12.0/main/src/main.rs.gdpu
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() -> amethyst::Result<()> {
)?
.with_bundle(TransformBundle::new())?;

let mut game = Application::new("/", MyState, game_data)?;
let mut game = Application::new(app_root.join("assets"), MyState, game_data)?;
0x6273 marked this conversation as resolved.
Show resolved Hide resolved
game.run();

Ok(())
Expand Down
8 changes: 8 additions & 0 deletions templates/0.13.2/index.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
"main/.gitignore",
"main/README.md.gdpu",
"main/Cargo.toml.gdpu",
"main/src/main.rs.gdpu",
"main/config/display.ron.gdpu",
"main/assets/.gitkeep",
]
9 changes: 9 additions & 0 deletions templates/0.13.2/main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Unwanted files
target

# Backup files
.DS_Store
thumbs.db
*~
*.rs.bk
*.swp
13 changes: 13 additions & 0 deletions templates/0.13.2/main/Cargo.toml.gdpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "{{ project_name }}"
version = "0.1.0"
authors = []
edition = "2018"

[dependencies]
amethyst = "{{ amethyst_version }}"

[features]
empty = ["amethyst/empty"]
metal = ["amethyst/metal"]
vulkan = ["amethyst/vulkan"]
26 changes: 26 additions & 0 deletions templates/0.13.2/main/README.md.gdpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# {{ project_name }}

## How to run

To run the game, use

```
cargo run --features "vulkan"
```

on Windows and Linux, and

```
cargo run --features "metal"
```

on macOS.

For building without any graphics backend, you can use

```
cargo run --features "empty"
```

but be aware that as soon as you need any rendering you won't be able to run your game when using
the `empty` feature.
Empty file.
4 changes: 4 additions & 0 deletions templates/0.13.2/main/config/display.ron.gdpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(
title: "{{ project_name }}",
dimensions: Some((500, 500)),
)
41 changes: 41 additions & 0 deletions templates/0.13.2/main/src/main.rs.gdpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
use amethyst::{
core::transform::TransformBundle,
prelude::*,
renderer::{
plugins::{RenderFlat2D, RenderToWindow},
types::DefaultBackend,
RenderingBundle,
},
utils::application_root_dir,
};

struct MyState;

impl SimpleState for MyState {
fn on_start(&mut self, _data: StateData<'_, GameData<'_, '_>>) {}
}

fn main() -> amethyst::Result<()> {
amethyst::start_logger(Default::default());

let app_root = application_root_dir()?;

let config_dir = app_root.join("config");
let display_config_path = config_dir.join("display.ron");

let game_data = GameDataBuilder::default()
.with_bundle(
RenderingBundle::<DefaultBackend>::new()
.with_plugin(
RenderToWindow::from_config_path(display_config_path)
.with_clear([0.34, 0.36, 0.52, 1.0]),
)
.with_plugin(RenderFlat2D::default()),
)?
.with_bundle(TransformBundle::new())?;

let mut game = Application::new(app_root.join("assets"), MyState, game_data)?;
0x6273 marked this conversation as resolved.
Show resolved Hide resolved
game.run();

Ok(())
}