pub struct Powerup {
pub kind: PowerupKind,
pub spawn_id: u64,
pub frac_x: f32,
pub frac_y: f32,
pub life_ticks: u32,
}Expand description
One on-screen powerup. Position is biscuit-fractional ([0, 1] on each
axis), same convention as Particle and the old GoldenCuque —
the marker stays anchored to its spot when the terminal resizes or the
user zooms.
spawn_id is a stable, monotonic identifier minted from
GameState::next_spawn_id at spawn time. Click hit-testing and the g
hotkey reference instances by id, never by Vec index — Vec indices shift
on swap_remove, and the input router holds layout rects across multiple
events, so a stable id is the only safe way to disambiguate “this
specific Frenzy among the three on screen.”
Fields§
§kind: PowerupKind§spawn_id: u64§frac_x: f32§frac_y: f32§life_ticks: u32Trait Implementations§
Auto Trait Implementations§
impl Freeze for Powerup
impl RefUnwindSafe for Powerup
impl Send for Powerup
impl Sync for Powerup
impl Unpin for Powerup
impl UnsafeUnpin for Powerup
impl UnwindSafe for Powerup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more