aboutsummaryrefslogtreecommitdiff
path: root/bombs.txt
blob: b6d4e78050ef99f01e5feec18d86d387ba0e4323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

Picking up bombs in the game seems simple enough... but the way they're
implemented in the code isn't.

Each level has:

- bomb graphics in the map data
- a list of bombs (indexed by 'coarse grid' coordinates)
- a list of map changes that happen when a bomb is picked up (optional)
- a subroutine that gets called on bomb pickup (optional)
- a subroutine that only gets called when certain bombs are
  picked up... but this isn't used in Jumpman Junior (probably
  it's a leftover from original Jumpman)
- another bomb-related list that I haven't figured out yet
- a byte that tells the game how many points a bomb pickup is
  worth... but it's set to $64 (100) on every level in the game.
- a shape to draw to replace the bomb, when it's picked up. Likely
  this is just a 4x4 blank square on most levels, but Figurits
  Revenge probably has a girder here instead (I can't remember if
  *every* bomb on that level causes a girder section to appear though)

Coarse Grid Coordinates
-----------------------

Effectively, the level is split into an invisible 8x8 grid, and only one
bomb can appear in each grid square. When a bomb is touched (detected
by GTIA collision register), the bomb_pickup routine gets called. It
turns the current player X and Y coordinates (in pixels/scanlines)
into coarse grid coordinates basically by lopping off the lower-order
bits. Since the Atari's display is larger than the visible portion,
the outermost grid squares are actually off the screen. This means the
grid is effectively more like 6x7 than 8x8. Each grid square can only
contain one bomb, so there's a limit of 64 (or really 42) bombs per level.

The coarse coordinates are combined into one byte, and this byte is
searched for in the bomb list. When it's found, its position in the
list is used as an index into the other two lists (the map changes list
and the one I don't know what it's for yet). If the byte isn't found
before the $FF that terminates the list, bomb_pickup returns (so no
points are awarded and no bomb-picked-up sound is heard, and the bomb
doesn't disappear... doesn't happen on any of the levels as far as I
can remember though).