-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: arrow entity handling and damage. #772
base: main
Are you sure you want to change the base?
Conversation
events/tag/src/module/bow.rs
Outdated
if owner.entity == event.client { | ||
return (0.0, owner.entity, I16Vec2::ZERO); | ||
} | ||
let chunck_pos = event.client.entity_view(world).get::<&Position>(|pos| { |
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.
The variable chunck_pos
contains a typo and should be renamed to chunk_pos
to maintain consistent spelling throughout the codebase.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
if owner.entity == event.client { | ||
return (0.0, owner.entity, I16Vec2::ZERO); | ||
} | ||
let chunck_pos = event |
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.
The variable chunck_pos
contains a typo and should be renamed to chunk_pos
to maintain consistent spelling throughout the codebase.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
So I have a couple thoughts. Mainly, if the ray code doesn't have an issue right now, let's not change it. Or let's try to at least move it to a separate PR if you think it's an optimization and won't break anything. I don't want to have this PR have too many separate changes in it. I also added benchmarking (#781). So if you're making a change like this, beyond the test passing, we should also see a big change in how long it takes to run the benchmarks, the micro benchmarks. Which will be pretty interesting. Also, okay, I suppose you can move spatial in, but in the future let's try to make modules separate. We should put some effort to making them separate in the future. |
crates/hyperion/tests/collision.rs
Outdated
world.get::<&AsyncRuntime>(|runtime| { | ||
const URL: &str = "https://github.com/andrewgazelka/maps/raw/main/GenMap.tar.gz"; | ||
|
||
let f = hyperion_utils::cached_save(&world, URL); | ||
|
||
let save = runtime.block_on(f).unwrap_or_else(|e| { | ||
panic!("failed to download map {URL}: {e}"); | ||
}); | ||
|
||
world.set(Blocks::new(&world, &save).unwrap()); | ||
}); |
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.
world.get::<&AsyncRuntime>(|runtime| { | |
const URL: &str = "https://github.com/andrewgazelka/maps/raw/main/GenMap.tar.gz"; | |
let f = hyperion_utils::cached_save(&world, URL); | |
let save = runtime.block_on(f).unwrap_or_else(|e| { | |
panic!("failed to download map {URL}: {e}"); | |
}); | |
world.set(Blocks::new(&world, &save).unwrap()); | |
}); | |
world.import::<hyperion_genmap::GenMapModule>(); |
@@ -55,6 +55,6 @@ fn arrow() { | |||
// gravity! drag! this is what was returned from the test but I am unsure if it actually | |||
// what we should be getting | |||
// todo: make a bunch more tests and compare to the vanilla velocity and positions | |||
assert_eq!(*position, Position::new(0.0, 21.947_525, 0.0)); |
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.
add a comment why this is true.
Arrow Entity handling and damage.
Arrow hitting blocks and damaging entities
Despawn Arrow and clamp velocity properly :)
hand animations 👍
fix bow?
first_collision rewrite. somewhat fixed arrow through floor