Experimental cursor missile effect#90
Draft
TanTanDev wants to merge 4 commits into
Draft
Conversation
|
I hope I'm speaking for everyone when I say this feature is exactly what ratty was created for. |
|
Incredible addition, should be considered @orhun |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(experimental, draft pull request)
I've implemented a cursor effect:

YouTube video showcasing the effect
What it does
When the cursor is detected to have moved, an entity with (3D model) OR (texture) spawn where the cursor was. this "missile" entity flies towards the new cursor location, and when it arrives, it spawns a "hit" texture. You can assign spawn and hit sound effects.
I implemented 2 versions, runescape and maplestory. All sound / art i added was made by me by hand.
Disclaimer
This is a draft pull request, because it's not fully implemented, and I don't intend to spend more time on this.
But since it's such a cool feature, I would like to share my implementation, if anyone want to pick it up.
What it would take to integrate
The implementation I made luckily was able to be put into a single plugin 'CursorEffectPlugin'.
The moment it's added to the bevy App, the cursor effect will always happen. There is no way right now to configure OR DISABLE the cursor, except via the code.
Known Issues:
SIDE-EFFECTS: Asset loading
When I ran the app with cargo r, bevy didn't look for asset folder from my repo, instead it looked inside /home/user/.cache/ratty/assets. to force the app to load from "assets" relative to the environment directory, I did this code change, which solved the issue for me. This should be examined for side-effects.
code change disclaimer
I had to make some functions public from systems.rs like active-mobious_progress, cursor_pose, and a bunch of structs inside systems.rs. Some of these functions I marked #allow(missing_docs)]
crate changes