pub struct ShipDepartureState { /* private fields */ }Expand description
Frame-driven state of the ship-departure cutscene. Constructed when the game’s departure script fires; ticked once per frame by the update loop (freezing gameplay, matching the classic blocking structure). The renderer reads the scroll offset and puff positions; the game applies the ship erase + warp removal at the erase transition.
Implementations§
Source§impl ShipDepartureState
impl ShipDepartureState
pub fn new() -> Self
Sourcepub fn tick(&mut self) -> Option<ShipDepartureSfx>
pub fn tick(&mut self) -> Option<ShipDepartureSfx>
Advance one frame. Returns the sound cue to play this frame, if any:
ShipDepartureSfx::Horn on the first scroll frame and on the
first erase frame.
pub fn is_done(&self) -> bool
pub fn phase(&self) -> ShipDeparturePhase
Sourcepub fn ship_erased(&self) -> bool
pub fn ship_erased(&self) -> bool
True once the ship should be shown as water: the erase phase has begun (the game’s map-block mutation lands at the same time; this flag covers the same frame for renderers that draw before the mutation takes effect).
Sourcepub fn scroll_iteration(&self) -> u16
pub fn scroll_iteration(&self) -> u16
Current iteration of the view scroll (0..=7), or 7 once the scroll finished (the erase phase keeps the final scrolled position).
Sourcepub fn scroll_substep(&self) -> u16
pub fn scroll_substep(&self) -> u16
Current drift substep within the scroll (0..=127 across all 8 iterations), or 127 once the scroll finished. Each substep lasts 8 frames.
Sourcepub fn scroll_px(&self) -> i32
pub fn scroll_px(&self) -> i32
Horizontal scroll of the map view in pixels (0..=128). The view
advances SHIP_DEPARTURE_SCROLL_PX_PER_ITERATION per iteration
and ramps one more pixel per 8-frame substep — net movement
16i + (substep+1).
Sourcepub fn puff_count(&self) -> usize
pub fn puff_count(&self) -> usize
Number of smoke puffs emitted so far (1 per iteration, 8 total). Puff i spawns at the start of iteration i, at the smokestack’s current screen position.
Sourcepub fn puff_x_offset(&self, i: usize) -> i32
pub fn puff_x_offset(&self, i: usize) -> i32
Screen-x offset (px) of puff i from the smokestack’s position at
departure start: spawns at X = 88 − 16i and drifts +2px per substep
from its spawn substep (the spawn iteration’s own drift loop moves
it immediately). Renderers rebase onto their own view by adding
(smokestack_screen_x - SHIP_DEPARTURE_PUFF_START_SCREEN_X).
Sourcepub fn puff_screen_y(&self) -> i32
pub fn puff_screen_y(&self) -> i32
Screen y (px) of every puff at departure start — the smokestack row (10.5 tiles).
Trait Implementations§
Source§impl Clone for ShipDepartureState
impl Clone for ShipDepartureState
Source§fn clone(&self) -> ShipDepartureState
fn clone(&self) -> ShipDepartureState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more