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.
This may sound confusing how I could use the z80 engine to work it in my project and get things programmed like oh let's say a RPG game?
does it need to be included in the main.c file or what? how one can use this engine to get programming a lot easier with this?
Offline
Check the tutorial on the github, it should help you understand it : https://github.com/Zal0/ZGB#tutorial
However I wouldn't recommend you to start making an RPG especially if you haven't completed a single game before. It needs a lot of work.
Offline
Yeah, you have to include your project in the engine, (not the engine in your project), github tutorial is very good.
Offline
Mills wrote:
Yeah, you have to include your project in the engine, (not the engine in your project), github tutorial is very good.
could linking a main.c to it work too if i used the engine? or it has to be writting in the engine's main?
Offline
Alexander the bat wrote:
Mills wrote:
Yeah, you have to include your project in the engine, (not the engine in your project), github tutorial is very good.
could linking a main.c to it work too if i used the engine? or it has to be writting in the engine's main?
You have to create an empty "state" (like the ones included in the template) declare it in main etc...
Then you have to include your program inside state functions (start, update), and replace loading functions (bkg, sprites, tiles...) with the zgb ones.
Offline
what about a Color Version of the game I planned to work on like a oh let's say a 256KB colored gameboy game of some sort?
Offline
Alexander the bat wrote:
what about a Color Version of the game I planned to work on like a oh let's say a 256KB colored gameboy game of some sort?
I added color functions to the engine, still has some bugs, you can check ZGB thread, I posted the demo uisng color.
Offline
Xephyr wrote:
Check the tutorial on the github, it should help you understand it : https://github.com/Zal0/ZGB#tutorial
However I wouldn't recommend you to start making an RPG especially if you haven't completed a single game before. It needs a lot of work.
Do you have the complete tutorial done on the ZGB template ?
Offline
Hello Everyone
I need help doing the Enemy chapter in the ZGB tutorial in github. So far I desgined the enemy. After that I got stuck so anyone wants to help me ?
However I done all previous chapters ?
Offline
Mills wrote:
I added color functions to the engine, still has some bugs, you can check ZGB thread, I posted the demo uisng color.
I am working on merging all the changes into the main branch. What bugs are you talking about?
npzman wrote:
Hello Everyone
I need help doing the Enemy chapter in the ZGB tutorial in github. So far I desgined the enemy. After that I got stuck so anyone wants to help me ?
However I done all previous chapters ?
What exactly is the problem?
Offline
Zalo wrote:
What bugs are you talking about?
The background animations use too much ram.. They will sometimes overwrite the carillon player variables if you add 6 or 7 animations in color mode... Anyway gameboy only can use 2 or 3 at the same time, and you can recicle the same animations and reload them with different data, so I think there should be no problems.
Offline
Thanks for actally starting to reply again .
Well in the chapter where I was adding ememys. I followed the steps but then there was an error when I compiled it was this :
C:\Users\owner\Desktop\ZGB-template>C:\gbdk\bin\make-3.81-bin\bin\make -C C:\gbdk\ZGB\common\src
make: Entering directory `C:/gbdk/ZGB/common/src'
make: Nothing to be done for `all'.
make: Leaving directory `C:/gbdk/ZGB/common/src'
C:\Users\owner\Desktop\ZGB-template>cd src
C:\Users\owner\Desktop\ZGB-template\src>C:\gbdk\bin\make-3.81-bin\bin\make run
compiling ZGBMain.c
ZGBMain.c(9):error *** Invalid directive
ZGBMain.c(11):error *** Invalid directive
ZGBMain.c(19):error *** code not generated for 'InitStates' due to previous errors
ZGBMain.c(23):error *** code not generated for 'InitSprites' due to previous errors
ZGBMain.c(27):error *** parse error before InitSprites
ZGBMain.c(29):error *** function 'InitSprites' already has body
ZGBMain.c(42):error *** code not generated for 'GetTileReplacement' due to previous errors
make: *** [../Release/ZGBMain.o] Error -1
C:\Users\owner\Desktop\ZGB-template\src>cd ..
C:\Users\owner\Desktop\ZGB-template>pause
Press any key to continue . . .
Offline
This is the code put in ZGBMain.c
#include "ZGBMain.h"
#include "StateGame.h"
#include "SpritePlayer.h"
#include "../res/src/player.h"
#Include "SpriteEnemy.h"
#Include "../res/src/enemy.h"
UINT8 next_state = STATE_GAME;
SET_N_STATES(N_STATES);
SET_N_SPRITE_TYPES(N_SPRITE_TYPES);
void InitStates() {
INIT_STATE(STATE_GAME);
}
void InitSprites() {
INIT_SPRITE(SPRITE_PLAYER, player, 3, FRAME_16x16, 3);
}
void InitSprites() {
...
INIT_SPRITE(SPRITE_ENEMY, enemy, 3, FRAME_16x16, 1);
}
#include "Math.h"
UINT8 GetTileReplacement(UINT8* tile_ptr, UINT8* tile) {
if(current_state == STATE_GAME) {
if(U_LESS_THAN(255 - (UINT16)*tile_ptr, N_SPRITE_TYPES)) {
*tile = 0;
return 255 - (UINT16)*tile_ptr;
}
*tile = *tile_ptr;
}
return 255u;
}
Offline
C is case sensitive. Try checking lines 9 and 11 for your error.
Offline
This tutorial part I am up to in the ememy section
void Start_STATE_GAME() {
...
SpriteManagerAdd(SPRITE_ENEMY, 70, 50);
}
What does "... " Mean ?
Last edited by npzman (2017-04-08 02:27:07)
Offline
Mills wrote:
The background animations use too much ram.. They will sometimes overwrite the carillon player variables if you add 6 or 7 animations in color mode... Anyway gameboy only can use 2 or 3 at the same time, and you can recicle the same animations and reload them with different data, so I think there should be no problems.
Ok... I'll see what I can do... I am not sure this is an engine feature but more a game specific one so I am not sure I am going to include them on the core (similar to why I didn't include any of the screen transition functions that I use in Super Princess). Remember the compiler doesn't remove unused functions and we need to make sure only the important ones are available on the core
Also, I see carrillon player has only been implemented for Game Boy Color, is this a limitation of the player?
Offline
@zal0 why delete the post ? Has the typo been fixed in the github page ?
Last edited by npzman (2017-04-08 08:11:01)
Offline
Does anyone have the resources to put a video tutorial for ZGB that's shows the installation and the tutorial from ZGB github page.
Offline
Well looks I am the only one that does. Sick of getting ignored so I decided to make my own here :
https://www.youtube.com/watch?v=KHaRJcfxYCQ
This is part 1 please give feedback
Offline