pub struct EnterMapSpinState { /* private fields */ }Expand description
State of the arrival spin animation.
Frame-driven: constructed when a teleport-class warp is committed;
ticked once per frame once the fade-in from white has completed (the
player stays hidden during the fade). spin_in_place mirrors the
standing-on-warp-pad check: arrivals on a warp pad/hole skip the final
spin-in-place.
Implementations§
Source§impl EnterMapSpinState
impl EnterMapSpinState
pub fn new( current_facing: Direction, spin_order: [Direction; 4], spin_in_place: bool, ) -> Self
Sourcepub fn tick(&mut self) -> Option<EnterMapSpinSfx>
pub fn tick(&mut self) -> Option<EnterMapSpinSfx>
Advance one frame. Returns the sound cue to play this frame, if any
(EnterMapSpinSfx::Descend at the start of the spin-down,
EnterMapSpinSfx::Land when it completes).
pub fn is_done(&self) -> bool
pub fn phase(&self) -> EnterMapSpinPhase
Sourcepub fn facing(&self) -> Direction
pub fn facing(&self) -> Direction
Current player facing (the spin rotating through the facing cycle).
Sourcepub fn player_y_offset(&self) -> i32
pub fn player_y_offset(&self) -> i32
Vertical pixel offset of the player sprite (≤ 0; the player descends from off the top of the screen into the standing position).
Sourcepub fn player_visible(&self) -> bool
pub fn player_visible(&self) -> bool
Whether the player sprite is still off the top of the screen.
Trait Implementations§
Source§impl Clone for EnterMapSpinState
impl Clone for EnterMapSpinState
Source§fn clone(&self) -> EnterMapSpinState
fn clone(&self) -> EnterMapSpinState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EnterMapSpinState
Source§impl Debug for EnterMapSpinState
impl Debug for EnterMapSpinState
Source§impl<'de> Deserialize<'de> for EnterMapSpinState
impl<'de> Deserialize<'de> for EnterMapSpinState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EnterMapSpinState
impl RefUnwindSafe for EnterMapSpinState
impl Send for EnterMapSpinState
impl Sync for EnterMapSpinState
impl Unpin for EnterMapSpinState
impl UnsafeUnpin for EnterMapSpinState
impl UnwindSafe for EnterMapSpinState
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