Skip to content

Creating a New Project

Zal0 edited this page Sep 13, 2021 · 3 revisions

Download this template.

Try to build it by launching build.bat or loading the project into Visual Studio. If you have problems compiling check the installation list again (specially make sure the ZGB_PATH env var is created)

If everything goes ok BGB will be automatically launched after the build and you should see something like this

enter image description here

The template contains the minimum files required for making a build:

  • ZGBMain.h: The Main file for your project, all states an sprites declarations must be done in this file
  • ZGBMain.c: This containts the default method for replacing tiles when adding them to the map, and the initial state that should be launched
  • SpritePlayer.c: this is the code of the Game Boy Sprite that you see on the screen. It does nothing, but has all the required methods
  • StateGame.c: the current State that makes a basic initialization:
    • Creates an sprite of type SPRITE_PLAYER and sets it as the scroll camera
    • Initializes the scroll (this will center the camera on the sprite set as camera and fill the background)
Clone this wiki locally