-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a library to handle tiled graphics #325
Comments
Interesting :) just to understand a bit better what you’re looking for: Are you talking about a static (background) tilemap? Also, what would |
Yes, I'm talking about background maps. The gameboy has a 32x32 tilemap that you can scroll (using rSCX and rSCY).
A concrete example would be: I have 2 different types of tiles: create GRASS-LAYER
mask: GRASS %00011000 %00000001 %10000000 %00000000
mask: GRASS %00111100 %00001111 %11100000 %00000000
mask: GRASS %00011100 %00000111 %11000001 %11000000
mask: GRASS %00000000 %00000000 %00000111 %10000000 Then I'll create some water streams: create WATER-LAYER
mask: WATER %00000000 %00000000 %00000000 %00000000
mask: WATER %00000111 %11100000 %00000011 %11110000
mask: WATER %11111000 %00011000 %00111100 %00001000
mask: WATER %00000000 %00000111 %11000000 %00000111 Then I can load both of them on the real map using GRASS-LAYER mask!video
WATER-LAYER mask!video I would get a final result looking like this:
|
Maybe we could also leave the tile identity to runtime: create MASK01
mask: %00000000 %00000000 %00000000 %00000000
mask: %00000111 %11100000 %00000011 %11110000
mask: %11111000 %00011000 %00111100 %00001000
mask: %00000000 %00000111 %11000000 %00000111
: load-map
MASK00 GRASS mask!video
MASK01 WATER mask!video
; So that you can create a lot of masks and reuse them with different tiles. |
But maybe I'll leave the mask thing out, and just provide a way to load maps. I'll put up a pull request soon. |
I’d probably agree on that. While I understand the use case for it in your situation, it doesn’t seem to be a very general need. That being said, looking forward to your contribution (and game!) :) |
I'm trying to make a top down strategy game using gbForth, and wonder how to easily render tiled maps on the screen.
For now, I'm using the
term.fs
library, but it feels clunky and unpractical to consider graphics as text lines. The machine tends to become slow as I try to render more lines of tiles to the screen (I currently prepare the map in RAM before sending it totype
, which explains the performance loss).I'm considering writing a library, something like
tilemap.fs
, to ease the creation and rendering of tilemaps.I'm opening this issue here to gather thoughts and directions on how to do that.
Plans
map:
:map!video
ormask!video
.The text was updated successfully, but these errors were encountered: