generated from eerii/hello-bevy
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: multiple changes and fixes 🌻
fix: now tilemaps work on web change: add back embeded assets this was some troubleshooting session...
- Loading branch information
Showing
16 changed files
with
175 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
a game for the bevy jam 4 | ||
|
||
_work in progress_ | ||
TODO: _write readme_ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use bevy::{prelude::*, render::view::RenderLayers}; | ||
|
||
use crate::GameState; | ||
|
||
// TODO: Spawn entities, follow pathfinding | ||
// TODO: Collisions between entities (traffic) | ||
// TODO: Multiple spawn points | ||
|
||
pub struct CharonPlugin; | ||
|
||
impl Plugin for CharonPlugin { | ||
fn build(&self, app: &mut App) { | ||
app.add_systems( | ||
OnEnter(GameState::Play), | ||
(init_game.run_if(run_once()), resume_game), | ||
) | ||
.add_systems(OnExit(GameState::Play), pause_game); | ||
} | ||
} | ||
|
||
// ·········· | ||
// Components | ||
// ·········· | ||
|
||
#[derive(Component)] | ||
pub struct GameCam; | ||
|
||
// ······· | ||
// Systems | ||
// ······· | ||
|
||
pub fn init_game(mut cmd: Commands) { | ||
// Camera | ||
cmd.spawn((Camera2dBundle::default(), RenderLayers::layer(0), GameCam)); | ||
} | ||
|
||
pub fn resume_game(mut cam: Query<&mut Camera, With<GameCam>>) { | ||
for mut cam in cam.iter_mut() { | ||
cam.is_active = true; | ||
} | ||
} | ||
|
||
pub fn pause_game(mut cam: Query<&mut Camera, With<GameCam>>) { | ||
for mut cam in cam.iter_mut() { | ||
cam.is_active = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.