Fixing BinaryParser Loader
This commit is contained in:
@ -31,11 +31,20 @@ level data at the top of the file.
|
||||
- 4 first bits : width
|
||||
- 4 last bits: height
|
||||
- next bytes -> Width * Height (+1 if Width * Height % 8 is not 0)
|
||||
- Position ( only for saved file )
|
||||
- 'F' and 'L' on 2 bytes for floating positions when the piece is not placed
|
||||
- x and y on 2 bytes for position if the piece is placed
|
||||
|
||||
### Saved file
|
||||
|
||||
For saved file, the extension will be .slevel
|
||||
The only difference is that at the end of the map data (after the pieces and before the
|
||||
Footer. there will be the position of each pieces from their top-left corner in the map.
|
||||
following this pattern for each pieces
|
||||
|
||||
- 'F' and 'L' on 2 bytes for floating positions when the piece is not placed
|
||||
- x and y on 2 bytes for position if the piece is placed
|
||||
|
||||
## Known Limitation
|
||||
|
||||
1) by putting the piece size on one byte. We limit the maximum piece size to 15 x 15 (1111 | 1111)
|
||||
I don't think we will ever need a piece larger than 5x5 so this is clearly a feature, not a bug! :-)
|
||||
We might use the same methods for the pieces positions but there could be a posibility to have
|
||||
larger map if I use 2 bytes for the positions.
|
||||
|
Reference in New Issue
Block a user