Update repo
This commit is contained in:
parent
c584111c4e
commit
5450a7e748
|
@ -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()
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
# CalcCity
|
||||
|
||||
A redesign of a management game like Sim's City.
|
||||
## 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.
|
Binary file not shown.
Before Width: | Height: | Size: 138 B |
Binary file not shown.
After Width: | Height: | Size: 613 B |
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 622 B |
Binary file not shown.
After Width: | Height: | Size: 866 B |
|
@ -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];
|
||||
};
|
||||
|
||||
|
||||
|
|
61
src/main.c
61
src/main.c
|
@ -1,8 +1,69 @@
|
|||
#include <gint/display.h>
|
||||
#include <gint/keyboard.h>
|
||||
#include <gint/std/stdlib.h>
|
||||
#include <gint/std/string.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue