Skip to content

Commit

Permalink
Fix github actions and minor demo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescarterbell committed Apr 17, 2024
1 parent a7d4580 commit 9d2fbd5
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 53 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags:
- '*'

env:
add_binaries_to_github_release: true
use_git_lfs: true


jobs:

# Build for Linux
release-linux:
runs-on: ubuntu-latest
environment: publish

steps:
- uses: actions/checkout@v4
with:
lfs: ${{ env.use_git_lfs }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: install dependencies
run: |
sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Test
run: |
cargo test --release --target x86_64-unknown-linux-gnu
- name: Get Dependency
run: |
cargo install cargo-release
- name: Login
run: |
cargo login ${{ secrets.CARGO_TOKEN }}
- name: Publish
run: |
cargo release publish \
--workspace \
--execute \
--all-features \
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members=[
]

[workspace.package]
version = "0.0.0-dev2"
version = "0.0.0-dev3"
edition = "2021"
authors = ["James Bell <[email protected]>"]
license = "MIT"
Expand Down
25 changes: 4 additions & 21 deletions crates/bevy_tiles/examples/basic_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,11 @@ fn move_character(
let map_id = map.single();
let walls = walls_maps.get_map(map_id).unwrap();

let mut x = if keyboard_input.just_pressed(KeyCode::KeyA) {
-1
} else {
0
};
x += if keyboard_input.just_pressed(KeyCode::KeyD) {
1
} else {
0
};
let x = keyboard_input.just_pressed(KeyCode::KeyD) as isize
- keyboard_input.just_pressed(KeyCode::KeyA) as isize;

let mut y = if keyboard_input.just_pressed(KeyCode::KeyW) {
1
} else {
0
};

y -= if keyboard_input.just_pressed(KeyCode::KeyS) {
1
} else {
0
};
let y = keyboard_input.just_pressed(KeyCode::KeyW) as isize
- keyboard_input.just_pressed(KeyCode::KeyS) as isize;

let char_c = character.get_single().unwrap();
let new_coord = [char_c[0] + x, char_c[1] + y];
Expand Down
36 changes: 6 additions & 30 deletions crates/bevy_tiles/examples/basic_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,38 +114,14 @@ fn move_character(
let map_id = map.single();
let walls = walls_maps.get_map(map_id).unwrap();

let mut x = if keyboard_input.just_pressed(KeyCode::KeyA) {
-1
} else {
0
};
x += if keyboard_input.just_pressed(KeyCode::KeyD) {
1
} else {
0
};
let x = keyboard_input.just_pressed(KeyCode::KeyD) as isize
- keyboard_input.just_pressed(KeyCode::KeyA) as isize;

let mut z = if keyboard_input.just_pressed(KeyCode::KeyW) {
-1
} else {
0
};
z += if keyboard_input.just_pressed(KeyCode::KeyS) {
1
} else {
0
};
let y = keyboard_input.just_pressed(KeyCode::ShiftLeft) as isize
- keyboard_input.just_pressed(KeyCode::ControlLeft) as isize;

let mut y = if keyboard_input.just_pressed(KeyCode::ShiftLeft) {
1
} else {
0
};
y -= if keyboard_input.just_pressed(KeyCode::ControlLeft) {
1
} else {
0
};
let z = keyboard_input.just_pressed(KeyCode::KeyS) as isize
- keyboard_input.just_pressed(KeyCode::KeyW) as isize;

let char_c = character.get_single().unwrap();
let new_coord = [char_c[0] + x, char_c[1] + y, char_c[2] + z];
Expand Down

0 comments on commit 9d2fbd5

Please sign in to comment.