Fix collider cube sizes, and more aggressively clear velocity.

This commit is contained in:
Nolan Darilek 2021-06-04 07:34:58 -05:00
parent ee751fbb74
commit 72c647385a

View File

@ -7,7 +7,7 @@ use bevy_tts::Tts;
use derive_more::{Deref, DerefMut};
use crate::{
core::{Angle, CardinalDirection, Coordinates, Player, PointLike},
core::{Angle, CardinalDirection, Player, PointLike},
error::error_handler,
exploration::{ExplorationFocused, Exploring},
map::{ITileType, Map},
@ -56,7 +56,7 @@ fn add_map_colliders(mut commands: Commands, maps: Query<(Entity, &Map), Added<M
let tile = map.base.at(x, y);
if tile.blocks_motion() {
let collider = ColliderBundle {
shape: ColliderShape::cuboid(1., 1.),
shape: ColliderShape::cuboid(0.5, 0.5),
..Default::default()
};
let collider_parent = ColliderParent {
@ -186,7 +186,6 @@ fn movement_controls<S, A: 'static>(
if let Some(strength) = strength {
direction *= strength;
}
//direction = transform.compute_matrix().transform_vector3(direction);
let mut v: Vector<Real> = (direction * **speed).into();
v = position.position.rotation.transform_vector(&v);
velocity.linvel = v;
@ -197,6 +196,7 @@ fn movement_controls<S, A: 'static>(
} else if sprinting {
**speed = **max_speed;
} else {
velocity.linvel = Vec2::ZERO.into();
**speed = **max_speed / 3.;
}
}