Skip to content

bana_advert

Anthony Samms edited this page Jun 1, 2026 · 2 revisions

The Bana advertisement plays inside the attract_camera panel on the title screen. It cycles through a fixed sequence of states that advertise the Bana Passport payment/reward system.

BanaAdState

An enum that tracks which slide is currently displayed.

Value Description
BANA_OPTIONS Intro slide showing Bana Passport and mobile wallet options
TAP_TO_READER Animation of a card/phone being tapped to the reader
REWARDS Rotating rewards icons with a bouncing Don-chan
CARD_OR_PHONE Card vs. phone comparison, alternating scale animation
GET Closing "get" slide with bouncing characters before looping back

BanaAdvertisement

All animations are pulled from the skin (second argument true to tex.get_animation), meaning their timing is defined in the skin script rather than in code.

BanaAdvertisement();

Initialises all animations and sets the initial state to BANA_OPTIONS. Only fade_in is started immediately; all others are started by the sequencer in update.

void update(double current_ms);

Advances every animation each frame, then drives a 16-step sequencer (steps_cursor) that transitions through the states in order:

  1. Steps 0–4 (BANA_OPTIONS): Wait for fade_in to finish, then alternate resize_1 and resize_2 twice each (four scale pulses on the options icons).
  2. Step 5: Hold for 300 ms, then transition to TAP_TO_READER and start the bana card rotate/move animations.
  3. Steps 6–9: Wait for the rotate to finish, play the touch animations (fade, up/down move, resize), hold 300 ms, then fade out and reset the touch animations.
  4. Steps 10–12: Repeat the tap sequence a second time, hold 600 ms, then transition to REWARDS and start Don-chan bouncing.
  5. Step 13 (REWARDS): Loop Don-chan's bounce animation 6 times. While in REWARDS, rewards_angle accumulates at 0.002 radians per millisecond to drive the rotating reward icons.
  6. Step 14 (CARD_OR_PHONE): Alternate resize_1 and resize_2 6 times to pulse the card and phone icons, then transition to GET.
  7. Step 15 (GET): Start the closing animations. The two characters bounce continuously (up then down, restarting on completion); character 1's bounce is delayed by 116 ms relative to character 0. When get_fade_out finishes, the state resets to BANA_OPTIONS and the sequencer restarts from step 0.
void draw(float x, float y);

Takes an (x, y) offset so the advertisement can be positioned within the camera panel. All sprites are offset by this value.

A scissor region is set to the bounds of CAMERA::BANA_ADVERT_OUTLINE (minus a 13-scaled-pixel bottom margin) so content never bleeds outside the panel.

Inside the scissor region, only the textures for the current state are drawn:

  • BANA_OPTIONS: BANAPASSPORT, OR, CHARA_0, and OSAIFUKEITAI, all faded in together and the passport/wallet icons scaled.
  • TAP_TO_READER: The card reader background, the tap card (rotated and moved), and the touch prompt (moved vertically and resized). A gleam overlay is shown only while touch_fade > 0 and then faded out with touch_fade_out.
  • REWARDS: Don-chan bouncing vertically, four reward icons arranged in a rotating carousel (each icon interpolates between four positional keyframes stored in the texture object's x/y arrays, driven by rewards_angle), plus top and bottom text.
  • CARD_OR_PHONE: Card and phone sprites scaled by resize_1 and resize_2 respectively, centered.
  • GET: The "GET" text scaled through a three-phase sequence (scale down → scale up → scale down again), faded in and then faded out together. The two characters bounce independently at their current offsets and fade out with get_fade_out.

Outside the scissor region, the outline sprite is drawn twice — once normally and once mirrored horizontally — to frame the panel.

Clone this wiki locally