Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Snake Block

Bryce edited this page Jan 31, 2022 · 8 revisions

The Snake Block is comprised of two parts, a sprite and the block movement data.

Sprite

Is 0 ba x y 0, where the fifth byte is needed but doesn't seem to do anything.

It is available in all graphic sets.

block movement data

Is its own section in the e-reader level file. It is right after sprites and before auto scroll data.

This doc's info is completely correct.

block movement data caveats

  • the snake must travel at least as far as its width. So if it is 5 wide, it needs to at minimum travel 5 tiles. If it travels less, it gets corrupted.
  • speed range is from 0-7, with 0 being extremely slow and 7 extremely fast. Nintendo seems to mostly use 2 as their speed.

when snake and block movement data are both present

Then the snake is properly rendered at whatever x/y you set it at. Once Mario lands on it, it performs the sequence as defined by the block movement bytes.

when there is a sprite but no movement data

Then the snake starts dormant as expected, but as soon as Mario touches it, it slides off the screen and out of the level.

If there is one snake with no block data, then this snake will be very long, about 12 tiles in length.

Sometimes this seems to lock the gba up, at least it seems to lock gbajs up. But not always.

two or more snakes in the room

If there is block data, then the first snake in the room (lowest x value) will perform the routine as expected. All the other snakes will slide off the screen. But unlike when there is one snake and no movement data, they will not be extra long.

possibly fifth byte is index?

just a guess, but maybe the fifth byte is an index, and block movement data can define multiple sequences? That would enable multiple snakes in one room.

Update: it doesn't seem to be. It might be a flag for like looping or something? So far I have not discovered it doing anything and setting it to any number seems to have no impact.

incompatible object sets

the snack block seems to create a corrupt blank tile that you can't interact with on certain object sets

  • 04
  • 06
  • 0c
  • 0d