Mechanic · movement · rail shooter
Barrel roll
A quick spin of the player's craft along its length, which in some games turns enemy shots away while it lasts.
On this page
A barrel roll spins the player’s craft along its length. In Star Fox 64 two presses of Z or R start the roll, and while a value tied to the spin is above 0, enemy shots that reach the Arwing are turned away and do no damage1.
- DeflectStar Fox 64 (1997). A second press of Z or R while the first press's 10-update count runs rolls the Arwing; while the roll's deflect value is above 0, enemy shots turn away and do no damage.1
Games
| Game | Year | How | Note |
|---|---|---|---|
| Star Fox 64 | 1997 | Deflect | a second press of Z or R while the first press's 10-update count runs rolls the Arwing; while the roll's deflect value is above 0, enemy shots turn away and do no damage |
Every claim about this mechanic, by game (1)
References
- ^ abIn the US 1.1 version of Star Fox 64, the Arwing rolls when Z or R is pressed twice. The first press sets that button's counter to 10, which
Player_UpdateArwingRollcounts down once per player update, and a second press while it is above 0 starts the roll, turning the ship 30 degrees an update for 10 updates and then slowing by 5 degrees an update until it stops.barrelRollAlphafalls by 30 every update while it is above 0, and in each update the roll's count is still above 0 after counting down (9 of its 10) it then gains 100, capped at 180, a net rise of 70 an update. While that value is above 0, the enemy-shot update (Effect_EnemyShot_Update) widens the shot's box around the player by 100 units on each axis, sends a shot inside it off in a new direction, and applies no damage.Codesonicdcer/sf64revisedHow we know
3397 if (gInputPress->button & Z_TRIG) { 3398 player->sfx.bank = 1; 3399 if (player->rollInputTimerL != 0) { 3400 player->rollState = 1; 3401 player->rollTimer = 10; 3402 player->rollRate = player->baseRollRate = 30; ⋮ 3405 player->rollInputTimerL = 10; ⋮ 3409 if (gInputPress->button & R_TRIG) { 3410 player->sfx.bank = 1; 3411 if (player->rollInputTimerR != 0) { 3412 player->rollState = 1; 3413 player->rollTimer = 10; ⋮
src/engine/fox_play.c lines 3397–3419 at 4235c59 · upstream ↗ 4823 if (player->barrelRollAlpha > 0) { 4824 player->barrelRollAlpha -= 30; 4825 if (player->barrelRollAlpha <= 0) { 4826 player->barrelRollAlpha = 0; ⋮ 4834 if (player->rollInputTimerL != 0) { 4835 player->rollInputTimerL--; ⋮ 4837 if (player->rollInputTimerR != 0) { 4838 player->rollInputTimerR--;
src/engine/fox_play.c lines 4823–4839 at 4235c59 · upstream ↗ 4846 if (player->rollTimer != 0) { 4847 player->rollTimer--; ⋮ 4850 if (player->rollState != 0) { 4851 player->rollInputTimerR = 0; 4852 player->rollInputTimerL = 0; ⋮ 4854 player->zRotBarrelRoll += player->rollRate; 4855 if (player->rollTimer == 0) { 4856 if (player->rollRate > 0) { 4857 player->rollRate -= 5; ⋮ 4859 if (player->rollRate < 0) { 4860 player->rollRate += 5; ⋮ 4862 if (player->rollRate == 0) { ⋮
src/engine/fox_play.c lines 4846–4870 at 4235c59 · upstream ↗ 5534void Player_UpdateOnRails(Player* player) { ⋮ 5545 Player_ArwingBank(player); 5546 Player_ArwingBoost(player); 5547 Player_ArwingBrake(player); 5548 Play_dummy_800B41E0(player); 5549 Player_UpdateArwingRoll(player);
src/engine/fox_play.c lines 5534–5549 at 4235c59 · upstream ↗ 2902 if (gPlayer[0].barrelRollAlpha != 0) { 2903 var_fa0 = 100.0f; ⋮ 2906 if (fabsf(gPlayer[0].trueZpos - this->obj.pos.z) < (50.0f + var_fa0)) { 2907 if ((fabsf(gPlayer[0].pos.x - this->obj.pos.x) < (30.0f + var_fa0)) && 2908 (fabsf(gPlayer[0].pos.y - this->obj.pos.y) < (30.0f + var_fa0))) { 2909 if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) { 2910 this->obj.rot.y = 90.0f; 2911 this->obj.rot.x = RAND_FLOAT(360.0f); ⋮ 2921 gPlayer[0].deflectCount++; 2922 AUDIO_PLAY_SFX(NA_SE_ROLLING_REFLECT, this->sfxSource, 0); ⋮ 2925 if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].mercyTimer == 0)) { 2926 Player_ApplyDamage(&gPlayer[0], 0, this->info.damage);
src/engine/fox_effect.c lines 2902–2926 at 4235c59 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Revised after a check by a second AI model, 2026-10-22.
Sources
Code
- sonicdcer and sf64 contributors. 2026. “sf64: a decompilation of Star Fox 64 (sonicdcer/sf64).” Commit 4235c59. sonicdcer/sf64 @ 4235c59 · licence, all uses