Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.


#1 2018-03-07 15:47:53

New member
Registered: 2018-03-07
Posts: 3

Prpblems With Backgrounds

I've been recreating snake for the gameboy with the gbdk, and I am having trouble with the background loading correctly.

The tiles that have been loaded into vram look like corrupted versions of the ones I made.

Here are the Tiles in vram, what the original tiles look like, and the map I made for it:

Here is the first bit of my code here:


#include <stdio.h>
#include <gb\gb.h>
#include <gb\drawing.h>
#include "Sprites\ShockedFace.c"
#include "Sprites\BlinkFace.c"
#include "Sprites\SnakeTiles.c"
#include "Maps\SnakeMap.c"

void main(){
    //Setup Variables
    int x = 75; // Our beginning x coord
    int y = 75; // Our beginning y coord
    //Setup Sprites
    set_sprite_data(0, 8, SF);
    set_sprite_tile(0, 0);
    set_sprite_tile(1, 2);
    move_sprite(1, 75 + 8, 75);
    move_sprite(0, 75, 75);
    //Draw Border
    set_bkg_data(0, 53, STiles);
    set_bkg_tiles(0, 0, 20, 18, SnakeMap);

Any help would be appreciated! big_smile



#2 2018-03-07 16:20:55

Registered: 2017-03-21
Posts: 25

Re: Prpblems With Backgrounds

Try looking through this thread:

They had similar issues with tile data initially. I believe it was a result of some incorrect export options from the tile/map editor tools.



#3 2018-03-07 20:18:19

New member
Registered: 2018-03-07
Posts: 3

Re: Prpblems With Backgrounds

Sorry, but I got the same results as before. I may have just didn't change the right thing, or I don't know what i'm doing well enough.

When I was looking at the c file for the tiles and it looks like it's doesnt match, but that may just be me talking:



#4 2018-03-07 20:22:40

New member
Registered: 2018-03-07
Posts: 3

Re: Prpblems With Backgrounds

Nvm, I just used common sense and changed it from 0 to 0, to, 0 to 53....

Thanks for the help though!



Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson