Skip to main content

game_toolkit_platformer/sim/
contacts.rs

1//! [`Contacts`]: what the body ran into in its last step, for an
2//! [`Ability::after`](super::Ability::after) that reacts to collisions (a wall-hit stun, a
3//! ceiling bonk that breaks a block, a ground pound).
4
5/// What the body's own movement ran into in the last step (not what moving ground did).
6#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
7pub struct Contacts {
8    /// A wall stopped it sideways: -1 on the left, 1 on the right, 0 none.
9    pub wall: i32,
10    /// Its head hit a ceiling ([`Event::Bonked`](super::Event::Bonked)).
11    pub ceiling: bool,
12    /// It touched down ([`Event::Landed`](super::Event::Landed)).
13    pub floor: bool,
14}