diff --git a/CMakeLists.txt b/CMakeLists.txt index f7455ba..8470387 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,10 +13,16 @@ set(SOURCES src/main.c ) +set(ASSETS) + set(ASSETS_fx - + assets-fx/large_tileset.png + assets-fx/large_water.png + assets-fx/title.png ) +set(ASSETS_cg) + fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA) add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}}) @@ -27,6 +33,6 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G) generate_g1a(TARGET myaddin OUTPUT "CalcCity.g1a" NAME "CalcCity" ICON assets-fx/icon.png) elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) - generate_g3a(TARGET myaddin OUTPUT "MyAddin.g3a" - NAME "MyAddin" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) + generate_g3a(TARGET myaddin OUTPUT "CalcCity.g3a" + NAME "CalcCity" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) endif() diff --git a/README.md b/README.md index 02ea0c4..34d2784 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # CalcCity -A redesign of a management game like Sim's City. \ No newline at end of file +## Presentation + +This game is a redesign of [CalcCity](https://www.planet-casio.com/Fr/programmes/programme1062-1-calccity-v3-menno-jeux-add-ins.html), a management game like Sim's City. + +## License + +All rights reserved. \ No newline at end of file diff --git a/assets-fx/icon.bmp b/assets-fx/icon.bmp deleted file mode 100644 index 50f4b69..0000000 Binary files a/assets-fx/icon.bmp and /dev/null differ diff --git a/assets-fx/icon.png b/assets-fx/icon.png new file mode 100644 index 0000000..44ab7e2 Binary files /dev/null and b/assets-fx/icon.png differ diff --git a/assets-fx/large_tileset.png b/assets-fx/large_tileset.png new file mode 100644 index 0000000..05e0ecf Binary files /dev/null and b/assets-fx/large_tileset.png differ diff --git a/assets-fx/large_water.png b/assets-fx/large_water.png new file mode 100644 index 0000000..4e611fe Binary files /dev/null and b/assets-fx/large_water.png differ diff --git a/assets-fx/title.png b/assets-fx/title.png new file mode 100644 index 0000000..af7c008 Binary files /dev/null and b/assets-fx/title.png differ diff --git a/src/calccity.c b/src/calccity.c new file mode 100644 index 0000000..e69de29 diff --git a/src/calccity.h b/src/calccity.h index 7b3612d..2a8cc5b 100644 --- a/src/calccity.h +++ b/src/calccity.h @@ -1,45 +1,44 @@ #ifndef _CALCCITY_H #define _CALCCITY_H -struct calccity = +struct calccity { // human's statistics = {happyness, health, education, housing, work, food} - signed long humans[6] = {0}; + signed long humans[6]; // population evolution = {population, birth_rate, death_rate, immigration, emigration} - signed long population[5] = {0}; + signed long population[5]; // trade statistics = {import, export, production, commercial, industrial, annual_cost} - signed long trade[6] = {0}; + signed long trade[6]; // production = {water, power} - signed long production[2] = {0}; + signed long production[2]; // consumption = {water, power} - signed long consumption[2] = {0}; + signed long consumption[2]; - // some others statistics = {crime, safety, fire_hazard, nuclear_hazard, pollution, transport, grabage, graves} - signed long misc[8] = {0}; + // some others statistics = {treasure, crime, safety, fire_hazard, nuclear_hazard, pollution, transport, grabage, graves} + signed long misc[9]; // taxes in percents on {housing, trade, industry, export} - int taxes[4] = {10, 10, 10, 10}; + int taxes[4]; // fund in percents on {police, fireman, education, heathcare} - int funds[4] = {0}; + int funds[4]; // in-game time - int month = 1, year = 1900; - int blinker = 0; + int month, year; + int blinker; // in-game options - bool disaster = true; - bool show_fps = false; - int time_speed = 30; + bool disaster; + int time_speed; }; -struct camera = +struct camera { int x, y; int zoom; @@ -48,9 +47,9 @@ struct camera = }; -struct map = +struct map { - unsigned char map_data[50][50]; + unsigned char data[50][50]; }; diff --git a/src/main.c b/src/main.c index 7115429..a678939 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,69 @@ #include #include +#include +#include + +#include "calccity.h" + +void title_screen(void); +void default_values(struct calccity *current_game, struct camera *camera, struct map *map); + int main(void) { + title_screen(); + + struct calccity calccity; + struct camera camera; + struct map map; + default_values(&calccity, &camera, &map); return 1; } + + +void title_screen(void) +{ + extern const bopti_image_t img_title; + dclear(C_WHITE); + + dimage(0, 0, &img_title); + dupdate(); + + getkey(); +} + + +void default_values(struct calccity *calccity, struct camera *camera, struct map *map) +{ + // Initialisation of struct calccity + memset(calccity, 0, sizeof *calccity); + + // Treasure + calccity->misc[0] = 500000; + + for (int i = 0; i < 4; i++) + calccity->taxes[i] = 10; + + calccity->month = 1; + calccity->year = 1900; + calccity->blinker = 0; + + calccity->disaster = true; + calccity->time_speed = 30; + + + // Initialisation of struct camera + memset(camera, 0, sizeof *camera); + camera->cursor_x = 64; + camera->cursor_y = 32; + + + // Initialisation of struct map + for (int y = 0; y < 50; y++) + { + for (int x = 0; x < 50; x++) + map->data[y][x] = 48 + rand() % 2; + } + +} \ No newline at end of file