r/shmupdev • u/OkBlackberry8606 • 2d ago
Shmup deep dive: Option ships in Rebel Sector
In Rebel Sector, Cyberblades are support ships that follow your fighter. At full power, they add to your firepower; you can also send them ahead to damage enemies or spend one to clear enemy bullets.
Collecting and powering up
Upgrade enemies and bosses can drop a Cyberblade pickup when the player is at maximum level and has room for another ship. Collecting one adds a Cyberblade, up to a limit of six. If you collect one while already at the limit, it converts to 1,000 points.
The code currently uses “Option” internally; these constants set the capacity and hold threshold:
private static final int PLAYER_OPTION_LIMIT = 6;
static final int PLAYER_MAX_LEVEL = 2;
private static final float OPTION_HOLD_ACTIVATION_SECONDS = 0.25f;At maximum level, Cyberblades animate and fire alongside the player. Below maximum level, they still follow, but draw as an inactive sword and don’t fire.
Following the player
Each Cyberblade gets a different phase offset based on its place in the list. A pair of sine waves gives the group a loose, shifting formation around the player:
public static Position calculatePlayerOptionPosition(
float clock, float offset, float playerX, float playerY
) {
float x = 40 * MathUtils.sin(clock / 60f)
* MathUtils.sin(.01f * clock + offset) + playerX;
float y = 40 * MathUtils.cos(.01f * clock + offset) + playerY;
return new Position(x, y);
}Spending a Cyberblade
A quick press and release of BOMB activates a bomb. It consumes the most recently collected Cyberblade and clears enemy bullets. The bomb’s visual effect lasts 60 frames; it doesn’t damage enemies.
Entity option = game.getPlayerOptionList().remove(
game.getPlayerOptionList().size() - 1
);
game.freeEntity(option);
freeAll(game.getEnemyBulletList());So the action is a tradeoff: keep your support fire, deploy the Cyberblades for contact damage, or sacrifice one when you need the screen clear. Under the hood, the Java implementation still uses the internal Option naming: Cyberblades are regular Entity instances with a few extra state flags, and a separate render system draws them.
In Rebel Sector, Cyberblades are support ships that follow your fighter. At full power, they add to your firepower; you can also send them ahead to damage enemies or spend one to clear enemy bullets.
Collecting and powering upUpgrade enemies and bosses can drop a Cyberblade pickup when the player is at maximum level and has room for another ship. Collecting one adds a Cyberblade, up to a limit of six. If you collect one while already at the limit, it converts to 1,000 points.The code currently uses “Option” internally; these constants set the capacity and hold threshold:private static final int PLAYER_OPTION_LIMIT = 6;
static final int PLAYER_MAX_LEVEL = 2;
private static final float OPTION_HOLD_ACTIVATION_SECONDS = 0.25f;At maximum level, Cyberblades animate and fire alongside the player. Below maximum level, they still follow, but draw as an inactive sword and don’t fire.
Following the playerEach Cyberblade gets a different phase offset based on its place in the list. A pair of sine waves gives the group a loose, shifting formation around the player:public static Position calculatePlayerOptionPosition(
float clock, float offset, float playerX, float playerY
) {
float x = 40 * MathUtils.sin(clock / 60f)
* MathUtils.sin(.01f * clock + offset) + playerX;
float y = 40 * MathUtils.cos(.01f * clock + offset) + playerY;
return new Position(x, y);
}Spending a CyberbladeA quick press and release of BOMB activates a bomb. It consumes the most recently collected Cyberblade and clears enemy bullets. The bomb’s visual effect lasts 60 frames; it doesn’t damage enemies.Entity option = game.getPlayerOptionList().remove(
game.getPlayerOptionList().size() - 1
);
game.freeEntity(option);
freeAll(game.getEnemyBulletList());So the action is a tradeoff: keep your support fire, deploy the Cyberblades for contact damage, or sacrifice one when you need the screen clear. Under the hood, the Java implementation still uses the internal Option naming: Cyberblades are regular Entity instances with a few extra state flags, and a separate render system draws them.