NesFishy game template: side scroller
=====================================

Game > Game Type > Side scroller, then Build and Run in Mesen (F6). NesFishy puts
your project into this folder ("<project>_sidescroller", next to the project),
builds the ROM with cc65 (ca65 + ld65) and opens it in Mesen. Set the cc65 tools
folder and Mesen in Workspaces > Settings.

Files
  main.s          the engine (yours: NesFishy copies it once; delete it to get a
                  fresh copy on the next build)
  nes.cfg         memory layout (NROM-256: 32 KB code + data, 8 KB tiles)
  modules/        add-ons, one folder each (see MODULES.txt)
  game_data.s     made on every build: palettes, the Map, tile properties, sprites,
  game_data.inc   Game Object tables, where objects are, the HUD, the options
  modules.s / chr.bin   made on every build
  <project>.nes   the ROM; game.lbl / game.dbg are labels for Mesen's debugger

What it does
  - The ship (the Player game object, e.g. the ready-made "Ship (side scroller)")
    flies 8 ways. There's no gravity.
  - Firing: hold the fire button (A or B, Game Options) for a shot every 8 frames,
    3 at once at most (both in Game Options). The shot is the first Projectile game object that doesn't
    hurt the player (the ready-made "Player shot"); it flies until a wall.
    Shots hurt enemies whose state can be hurt (by the shot's damage) and give
    their points when they're destroyed.
  - Walls: tiles with the 1st property (solid) stop the ship, enemies and shots.
    The top (under the HUD) and the bottom of the screen are walls too.
  - Enemies (the move type of their state):
      Stand still            floats in place, bobbing up and down
      Patrol                 back and forth, turning at walls and every 64 frames (Game Options)
      Patrol (walls / ledges) up and down, turning at walls and every 64 frames (Game Options)
      Chase / Fly toward the player / Keep going   as in the other templates
    Enemies that hurt the player take its health (it blinks for a second);
    pickups add points and coins.
  - Scrolling (Game > Game Options, saved in the project):
      Auto-scroll speed      0 = the camera follows the ship; more = the screen
                             scrolls right on its own (16 = a pixel a frame) and
                             its left edge pushes the ship
      Can go backwards       the camera may go back left (else never)
      Up and down Map rows   the Map is one world: hold Up at the top or Down at
                             the bottom to fly into the row above / below (a
                             quick cut, same place). Off: each Map row is a level
                             and reaching its right end starts the next one.
  - HUD (the first top HUD, kept still while scrolling), score, coins, lives (3),
    time, sounds (modules/sfx, SND_SHOOT for shots) like the other templates.
  - Up to 12 objects at once (shots count); sprites take turns when there are
    too many on a line.

Not in this version yet: enemy shots aimed at the player, patrol paths through
set points, smooth vertical scrolling, bosses, music.

Game Types and Game Options
  This folder is a copy of templates\sidescroller\ (next to NesFishy.exe). Every folder
  there with a main.s shows up in Game > Game Type; copy one to make your own.
  template.ini names it and lists its Game Options (Game > Game Options): each
  one is written to game_data.inc as a constant (e.g. START_LIVES = 3) on every
  build, so main.s and modules can use it. Add options to template.ini for your
  own constants.

Palettes per screen, flip-screen and fades
  Each Map screen can use its own palette set (right-click it on the Map, or pick
  one for the whole screen in the Screens list). Only one set can be on the TV at
  a time, so when the middle of the camera reaches a screen with another set the
  game fades out, swaps the set and fades back in (Game Options: fade speed, 0 =
  swap at once). With Flip-screen on, the camera shows one whole screen at a time
  and cuts to the next when the player crosses into it (a different set fades in
  from black).

Title, Game Over and Ending screens
  Right-click an entry in the Screens list > In the Game: Level (its Map is the
  game's levels), Title screen (shown at power on until Start), Game Over screen
  (when the lives run out, then back to the title) or Ending screen (after the
  last level). Each shows its screen with its palette set, using the levels' tiles.

Players, saving, PAL (Game Options)
  2 players: controller 2 moves a second Player (the second Player game object,
  or a copy of the first); the players share the lives. Battery save: keeps the
  high score and how far you got (Start continues, Select + Start starts over); a
  HUD number named "High" shows the high score. Same speed on PAL: 50 Hz consoles
  take an extra step every 5 frames. Game Object states can be drawn behind the
  background ("Behind the background" in the Game Object builder).

Music (FamiStudio)
  Game > Music Files: pick the songs (and sound effects) exported from FamiStudio
  (File > Export > FamiStudio Sound Engine Assembly, CA65). Each build copies them
  into music/ here; music/famistudio_ca65.s is the FamiStudio sound engine. A .dmc
  file next to the music file brings its DPCM samples (placed at the end of the
  ROM). The Sounds panel says which song plays where: each Map screen's music (it
  starts when the camera reaches that screen), the Title / Game Over / Ending
  screens' music (or a game state named Title / Game Over / Ending). Sound
  effects named Jump, Hurt, Stomp, Pickup, Die, Level / Door, Shoot play through
  FamiStudio; the others still use the sfx module. The pause module pauses the
  song too.

Cartridge: NROM or MMC3 (Game Options > Cartridge)
  NROM: 32 KB, one 8 KB set of tiles. MMC3 (256 KB, mapper 4): each level gets
  its own 16 KB bank for its screens (up to 15 screens a level, 14 levels; top-
  down: 15 screens a bank), every CHR bank of the project goes in, the Title /
  Game Over / Ending screens show with their own CHR bank, and the CHR Animation
  bank swaps (128- or 256-tile regions) play in the game. The code and the other
  data stay in the fixed 16 KB at $C000 (with the music and DPCM samples).
  NesFishy links with nes_mmc3.cfg then.

Splits: parallax, wavy water, a bottom status bar (MMC3)
  The Scroll / Mirroring Preview's splits (View > Scroll / Mirroring Preview) are
  saved in the project and the game uses them with the MMC3 cartridge: each band
  below a split line is Fixed (its own X), Main (with the camera), Parallax (the
  camera's X at its speed, plus an offset) or Wavy (with the camera, its lines
  rippling left and right). The band under the top HUD moves at the "Top band"
  speed. Up to 6 splits; only X changes mid-screen. For parallax the band's rows
  should look the same all along the level (sky, far hills): the band shows the
  level's own tiles, scrolled at another speed. A HUD placed at the Bottom (HUD /
  UI Boxes) becomes a status bar kept still at the bottom (2, 6 or 8 rows). Use
  8x8 sprites with splits (the MMC3 counts lines with the sprite fetches).

Smooth up and down scrolling (Game Options > Up and down Map rows = Smooth)
  The Map rows make one tall world (up to 8 rows) and the camera follows the ship
  up and down as well as sideways; new rows of tiles stream in like the columns.
  Objects live anywhere in it (y in world pixels). The top and bottom of the
  world are walls. The HUD (Game Options > HUD with smooth scrolling): left out,
  Sprites (the top HUD's numbers and meters drawn as sprites, each in its
  element's palette, used as a sprite palette; at most 8 on a row; boxes and text
  are left out) or Status bar (MMC3: the whole top HUD stays still at the top,
  kept in a third nametable with 4-screen VRAM; an IRQ shows the level under it
  and again where the level's rows wrap; no splits then; the top of the world is
  under the bar). With the MMC3
  cartridge every screen goes in one bank: up to 15 different screens (repeated
  screens are stored once); the splits still work, moving their bands sideways
  only. The rows where two Map rows meet can show a palette mixed from both for a
  moment (attributes).
