/nano_dungeons

A work in progress NES game

Primary LanguageAssemblyMIT LicenseMIT

This readme will serve as the design document of nesblox.

Part 1: Gameplay
=================

The gameplay of nesblox is going to be pretty simple.
The objective of the game is to move the player character throguh a dungeon.
The dungeon contains enemies, power-ups and an exit.

Part 2: Other features
=======================
The game should use a mapper with as little features as possible.
Generally a few banks of rom should do to contain the game.
One bank of sram should also be enough depending on how well compression works.

All graphics design can be easily done using Mesens PPU viewer.
Once done simply export the CHR ROM to a dump and it can be included using .incbin.

Part 3: Level Compression:
==========================
Level compression is implemented using a very simple format.
It is simply stores a number of repeates followed by the tile to be repeated.
A repeate sequence is indicated with a value of $FF consequently making $FF an invalid
tile not to be used. If an FF does not preceede a value it simply means it is a single occurance of a tile.
The end of data is indicated by $FF $00
Example:

$01 $02 $02 $03 $FF $09 $FA $FF $00

This will expand to:
$01 $02 $02 $03 $FA $FA $FA $FA $FA $FA $FA $FA $FA

This simple example saved 3 bytes in total.


PART 4: Audio format:
=====================
All audio data is placed in in the following format.
duty, note

Where timer_frames is the amount of frames a note plays for and note
is a value is an offset in the periode lookup table.
Duty is the duty setting for this note.
Sweep is a value for the sweep unit that is unused as of now.
If duty is $FF no update will happen.
If duty if $FE no update will happen, but the audio pointer will still increment.

Noise:
=======
The noise format is slightly different

duty, note, length counter

Part 5: Notes (To be removed):
===============================

TODO init save data (magic number?)
TODO implement low visiblity mode.
    - Move sprites off-screen if out of range
    - reveal map when player moves
    - init routine for initial visiblity
TODO make inital map loading code and reset code the same for gameplay
TODO map loading in low visibility mode does not work correclty when using jump tiles
TODO do not render sprites that are outside of vield of view in low visiblity mode
TODO UI that displays current armor/damage values
TODO delay sprite move after hit to give player time to dodge
TODO throwing knife weapon. Travels until hits a wall, an enemy. Uses 1 damage each use.
TODO add coin drops from enemies
TODO add shop levels (sell poison DOT for weapon, sell shiled)
TODO add boss levels

Blocks:
- Wall blocks (cannot be walked on)
- Space blocks (can be walked on)
- One way blocks in all directions
- Switch blocks that make blocks (im)passible. Switch blocks will be blocked off with sprites
- Start block (TODO handle error when no start is present)
- Teleport blocks/Jump blocks
- Push block, pushable block may also be pushed onto empty tile where it then "falls"
- Red door, opens when Red door key is collected
- Blue door, opens when Blue door key is collected
- Green door, opens when Green door key is collected
- Bombable block

- Mimmic AI that copies player can interact with switches (inverted sprite of player?)
- Skel AI moves randomly
- Bat AI moves left, until wall then right until wall
- Scorpion AI moves up, until wall then down until wall
- Block that changes solid every time player moves
- Staircase tile as "goal" (sets tiles to clear to 0)
- Bomb pickup 
- Armor Pickup, +1 hp pickup

- Add weapon damage pickup
- Add health bar 3 hearts
- Add health pickup
- Add hp to enemies
- Randomly generate dungeons??
- Make rendering so it only renders a few tiles around the player
  when the map first loads. Then on every move load
  a row of tiles (6 or so) in the direction the player went.

- Fix movement, quick tap in direction changes facing direction, long press starts move
  this will allow better combat

TODO:
Each map may have up to 32 sprite based tiles. each of those tiles gets 1 sprite slot assigned.
These tiles are looked for in the same routine as the find_start tile.
Enemy AI needs to check if it collided with player
Death Animation
Play sounds for sword slash, key pickup, sword pickup, door open

Setting:
You are a wizard who must venture through the dungeon to find the necronomicon.
On the way you must prove your wit, and avoid deadly bats, skelletons and other creatures.