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

We must have googly eyes (new Game example) #12331

Merged
merged 10 commits into from Mar 6, 2024

Conversation

tjamaan
Copy link
Contributor

@tjamaan tjamaan commented Mar 6, 2024

Objective

  • We must have googly eyes.
  • Also it would be nice if there was an example of a desk toy application (like the old NEKO.EXE).

Solution

  • Created an example with googly eyed Bevy logo under examples/games/desktoy.rs.

Changelog

  • Added "Desk Toy" game example showcasing window transparency and hit test.

Copy link
Contributor

github-actions bot commented Mar 6, 2024

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@rparrett rparrett added C-Examples An addition or correction to our examples C-Enhancement A new feature labels Mar 6, 2024
Cargo.toml Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@tjamaan tjamaan left a comment

Choose a reason for hiding this comment

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

Updated as per comments and added more documentation.

I didn't turn the drag operation into a state machine since there is no cleaner way to test if there is a current drag operation while also storing the drag offset. E.g. there is no resource_equals equivalent that would ignore the inner enum values.
However I renamed DragOffset to DragOperation to make it clearer that this resource represents the drag operation.

examples/games/desktoy.rs Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
@alice-i-cecile alice-i-cecile added the C-Needs-Release-Note Work that should be called out in the blog due to impact label Mar 6, 2024
@alice-i-cecile
Copy link
Member

In case it wasn't clear: I genuinely think we should include this. This is a nice well-scoped example demonstrating a new flavor of app, and I think that there's real pedagogical and marketing value to the fact that it's also extremely funny.

examples/games/desktoy.rs Outdated Show resolved Hide resolved
examples/games/desktoy.rs Outdated Show resolved Hide resolved
typo

Co-authored-by: Rob Parrett <robparrett@gmail.com>
examples/games/desktoy.rs Outdated Show resolved Hide resolved
@rparrett
Copy link
Contributor

rparrett commented Mar 6, 2024

I think this should be named desk_toy.rs.

@SpecificProtagonist
Copy link
Contributor

Nice! Testing this on Cinnamon, there are some problems with desktop mode though:

@tjamaan
Copy link
Contributor Author

tjamaan commented Mar 6, 2024 via email

Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

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

Very fun! Definitely on board, especially with tweaks to the velocity and decay as mentioned in the comments above.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Mar 6, 2024
@alice-i-cecile
Copy link
Member

@tjamaan ping me once you've tweaked the physics and I'll merge this in :)

@alice-i-cecile
Copy link
Member

cargo fmt is failing :)

@tjamaan
Copy link
Contributor Author

tjamaan commented Mar 6, 2024

cargo fmt is failing :)

I have automatic format on save configured and I also ran cargo fmt manually. Can you share the error?

e: It appears that was because it checked before I fixed the references to the renamed file.

@tjamaan
Copy link
Contributor Author

tjamaan commented Mar 6, 2024

@alice-i-cecile I've toned down the bounciness, cleaned up the code as suggested, and renamed the file to desk_toy.rs

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 6, 2024
Merged via the queue into bevyengine:main with commit 6f2ecdf Mar 6, 2024
29 checks passed
spectria-limina pushed a commit to spectria-limina/bevy that referenced this pull request Mar 9, 2024
# Objective

- We must have googly eyes.
- Also it would be nice if there was an example of a desk toy
application (like the old NEKO.EXE).

## Solution

- Created an example with googly eyed Bevy logo under
examples/games/desktoy.rs.

---

## Changelog
- Added "Desk Toy" game example showcasing window transparency and hit
test.

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Enhancement A new feature C-Examples An addition or correction to our examples C-Needs-Release-Note Work that should be called out in the blog due to impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants