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 player movement code #70

Merged
merged 31 commits into from
Jul 8, 2024
Merged

Add player movement code #70

merged 31 commits into from
Jul 8, 2024

Conversation

janhohenheim
Copy link
Member

@janhohenheim janhohenheim commented Jul 8, 2024

Adapted from bevyengine/bevy#14223
Resolves #10
Resolves #11

I'm intentionally using FixedUpdate here instead of a very minimal example since I expect many jam submissions to do some kind of player movement, so it's best to show them how it's done correctly right away.
I also moved the level spawning away from screen because that's a game detail and not a screen transition detail.

The input is not nicely abstracted away because when I started doing that, I noticed I was basically reimplementing LWIM. Better to just link to that imo.

I know that @benfrankel said that physics go in core, but I intentionally placed them in game here because I expect the physics handling to be vastly different from game to game and I want to make it obvious to users that they are encouraged to change the implementation according to their needs. The rest of core is comparatively tame; I expect many will leave most of it untouched.

src/game/physics.rs Outdated Show resolved Hide resolved
src/game/physics.rs Outdated Show resolved Hide resolved
src/game/level.rs Outdated Show resolved Hide resolved
src/game/level.rs Outdated Show resolved Hide resolved
Co-authored-by: MiniaczQ <xnetroidpl@gmail.com>
src/game/level.rs Outdated Show resolved Hide resolved
@janhohenheim janhohenheim requested a review from MiniaczQ July 8, 2024 15:56
Co-authored-by: MiniaczQ <xnetroidpl@gmail.com>
src/game/spawn/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: MiniaczQ <xnetroidpl@gmail.com>
src/game/spawn/level.rs Outdated Show resolved Hide resolved
src/game/spawn/level.rs Outdated Show resolved Hide resolved
src/game/spawn/mod.rs Outdated Show resolved Hide resolved
src/game/spawn/player.rs Outdated Show resolved Hide resolved
@janhohenheim janhohenheim requested a review from benfrankel July 8, 2024 16:41
Copy link
Collaborator

@benfrankel benfrankel left a comment

Choose a reason for hiding this comment

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

Comments on the code, not on the physics mainly.

src/game/movement.rs Show resolved Hide resolved
src/game/movement.rs Outdated Show resolved Hide resolved
src/game/physics.rs Show resolved Hide resolved
src/game/physics.rs Outdated Show resolved Hide resolved
src/game/spawn/player.rs Show resolved Hide resolved
@janhohenheim janhohenheim requested a review from benfrankel July 8, 2024 18:50
@janhohenheim janhohenheim enabled auto-merge (squash) July 8, 2024 19:17
Copy link
Collaborator

@benfrankel benfrankel left a comment

Choose a reason for hiding this comment

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

Not blocking on comments, better to get this in now so it can be iterated on.

src/game/spawn/player.rs Show resolved Hide resolved
@janhohenheim janhohenheim merged commit 088f1b2 into main Jul 8, 2024
3 checks passed
@janhohenheim janhohenheim deleted the player-movement branch July 8, 2024 19:42
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.

Add a basic game interaction Setup a basic SystemSet enum for the game
3 participants