Skip to content

[WIP] Supermath101's work on the player and controls#3

Draft
Supermath101 wants to merge 3 commits into
mainfrom
supermath101
Draft

[WIP] Supermath101's work on the player and controls#3
Supermath101 wants to merge 3 commits into
mainfrom
supermath101

Conversation

@Supermath101
Copy link
Copy Markdown
Collaborator

@Supermath101 Supermath101 commented Feb 26, 2022

Still working on completing the controls.
Player controls is now in an MVP state.

Comment thread src/singleplayer/mod.rs
.add_system_set(
SystemSet::on_enter(GameState::Playing).with_system(singleplayer_setup),
SystemSet::on_enter(GameState::Playing)
.with_system(singleplayer_setup.label("2d_map_setup"))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the next line is a hacky way to integrate the singleplayer and player crates together. Does anybody have a better idea?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. Alternatively you can create a single setup system and from there call the create map and create player fns but then you would need to pass in the system params.

Comment thread src/main.rs Outdated
use bevy_egui::EguiPlugin;

mod menus;
mod player;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this at least for the time being into the singleplayer crate (it's unlikely we will have multiplayer within the frame of this jam).

Comment thread src/menus/common.rs Outdated
@@ -1,12 +1,16 @@
//! Some UI utility functions and structs.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment doesn't really add anything useful (it's clear what the statement does already), would recommend removing

Comment thread src/player/mod.rs Outdated
@@ -0,0 +1,41 @@
use bevy::prelude::*;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned before I would move this into singleplayer and rename it to player.rs as it probably won't need its own folder

Comment thread src/player/mod.rs Outdated
});
}

pub fn cleanup_player(mut commands: Commands, query: Query<Entity, With<Player>>) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably not necessary - full scene transitions can just despawn everything. In player death scenarios, the systems that detect/cause them would likely despawn the player themselves

Comment thread src/singleplayer/mod.rs
.add_system_set(
SystemSet::on_enter(GameState::Playing).with_system(singleplayer_setup),
SystemSet::on_enter(GameState::Playing)
.with_system(singleplayer_setup.label("2d_map_setup"))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. Alternatively you can create a single setup system and from there call the create map and create player fns but then you would need to pass in the system params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants