コード例 #1
0
ファイル: main.c プロジェクト: gingerBill/LD35
void
init(void)
{
	CORE->palette.colors[PC_TRANSPARENT] = color_make(0x00, 0x00, 0x00, 0x00);
	CORE->palette.colors[PC_TRUE_BLACK]  = color_make(0x00, 0x00, 0x00, 0xff);
	set_palette_set(PS_WHITE); // IMPORTANT NOTE(bill): This must be white as the spritesheet is white

	CORE->palette.colors_count = PC_COUNT;
	canvas_clear(1);

	bitmap_load_resource(&spritesheet, "spritesheet.png");
	bitmap_load_resource(&title_screen, "title_screen.png");

	bitmap_load_resource(&font.bitmap, "font.png");
	font.char_width = 4;
	font.char_height = 7;


	CORE->font = &font;

	init_game();

#if 0
	set_palette_set(PS_WHITE);
#endif
}
コード例 #2
0
int
init()
{
    CORE->window.width = 16 * 8;
    CORE->window.height = 16 * 8;
    CORE->window.scale = 5;

    GAME = bank_push_t(CORE->storage, Game, 1);

    sound_load_resource(&GAME->sound_jump, "jump.ogg");
    sound_load_resource(&GAME->sound_land, "land.ogg");

    font_load_resource(&GAME->font, "font.png", 4, 7);
    CORE->canvas.font = &GAME->font;

    bitmap_load_resource(&GAME->tileset, "tileset.png", 0);
    GAME->tileset.tile_width  = 8;
    GAME->tileset.tile_height = 8;

    // Load scenes.
    Tiled tiled;
    tiled_init(&tiled);
    tiledscene_load_resource(&tiled, &GAME->scene1, "map1.json", 0, 0);
    tiled_free(&tiled);

    // Initialize game scene.
    scene_init(&GAME->scene, 16);

    // Start at first scene.
    scene_setup(&GAME->scene1);

    return 1;
}