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.
I get this error, when projectiles are spawned via functions. It only happens when my tileset / map exceed the number of 35 tiles. Under this number, the function works properly. Memory issue? Bad coding? Did I miss something? Iīm using the latest release of ZGB.
This is the code of the enemy, which will spawn a bullet.
if(data->DIR_Y == -1) { SPAWN_BULLET(THIS->x+6, THIS->y, 0, -1); }
This is the code of the bullet.
void SPAWN_BULLET(UINT16 x, UINT16 y, INT8 vx, INT8 vy) { Sprite* bullet = SpriteManagerAdd(SpriteBullet, x, y); struct BULLET_DATA* data = (struct BULLET_DATA*)bullet -> custom_data; data-> vx = vx; data-> vy = vy; data-> DAMAGE = 1; }
Offline
what BGB shows you above is, obviously, execution of data. that might happen because of some sort of overflow/corrupting WRAM. what version of ZGB do you use? is it latest?
Offline
Yeah, 2021.2 Version. I changed how the projectiles are spawned and now it works fine.
Thanks for your interest, toxa. When you see this message, maybe you can tell me something about the VRAM. Is it possible to "clean" or to remove certain tiles from the VRAM to make up space for new sprites? Different levels, different enemies. Thatīs the idea. Is the limit really 256 non-BG tiles for the whole game?
Last edited by freshdeus (2021-10-14 16:31:10)
Offline
just overwrite old data with new
Offline
I donīt wanna sound like an annoying first-grader, but how can I force old data to be overwritten in ZGB? I am a absolute novice when it comes to coding and old machines...
Offline