-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
flappy bevy example #4923
flappy bevy example #4923
Conversation
birds sometimes fall out of the sky
examples/games/flappy_bevy.rs
Outdated
} | ||
|
||
#[derive(Component)] | ||
struct Chaos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that Chaos, Gravity or DriftToCenter components have value; the behavior can be configured based on adding and removing the systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't remove systems from a schedule, right? At most have a run criterion to disable them. Also these components are not global, but specific to the properties of specific entities it seems, so globally adding or removing systems wouldn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These systems could all operate on Bird. I've been using a Component for each distinct behavior if possible for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the main thing here is that when designing which components I use, I try and think about this in terms of future extensibility.
I think that Gravity is plausible to extend, but the others probably aren't? That said, I think there's an argument for keeping this as minimal as possible to improve the clarity as a learning example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue for keeping these micro-components separate as they can be copy-pasted into new users' projects.
#2504 would help make this example much cleaner. |
My opinion is that this example is appealing and valuable: it more clearly demonstrates some of the fundamental notions of ECS (operating on groups of entities) than the Breakout example. I'd like to include this, and later work towards a more scalable example presentation schema than large nested folders. |
Is there anything else I need to do to move this along? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just needs another couple of reviews :) I want more discussion and feedback on whether we should add this as another game example, but I'm happy with the code itself now.
The main drawback is that this is more code to maintain, and doesn't necessarily showcase new concepts. My personal opinion is that it's worth it on the balance, but we still need a better solution to manage the growing collection of examples.
If you want to be proactive about it, starting a thread on Discord about this PR is the best way to stimulate that sort of discussion IME.
this game could use a "restart" or "you lost" screen. as is, if you start the example and don't do anything, the birds fall down and out of the screen and you end up not being able to do anything but quitting |
I have some ideas to make the game more player-friendly, but I've implemented none of them in a bid to keep the example minimal.
1 & 2 are implemented in the following commit, which also fixes the 'birds falling out of the sky' issue by putting the |
From a pure game design perspective, I like 2 but not 1. Player agency is good! I don't think 3 is needed. Overall I would prefer restarting the game using states and a Game Over screen rather than startup systems. It demonstrates how to handle this pattern much more realistically, and is worth the added length. |
Backlog cleanup: had a crack at this one myself! But see linked PR for discussion, probably consign this to history with thanks to the original contributor. |
Objective
Solution