aboutsummaryrefslogtreecommitdiff
path: root/src/engine/level_const.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/level_const.c')
-rw-r--r--src/engine/level_const.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/engine/level_const.c b/src/engine/level_const.c
index 896d0e0..2522814 100644
--- a/src/engine/level_const.c
+++ b/src/engine/level_const.c
@@ -4,7 +4,11 @@
hh_g_all_levels hh_init_game_levels(){
hh_g_all_levels levels;
- levels.current_level=0;
+ levels.current_level=1;
+
+ levels.shop.size.x=40;
+ levels.shop.size.y=15;
+ levels.shop.hh_level_completed=false;
levels.level[0].size.x=40;
levels.level[0].size.y=100;
@@ -14,9 +18,9 @@ hh_g_all_levels hh_init_game_levels(){
levels.level[1].size.y=28;
levels.level[1].hh_level_completed=false;
- FILE *fp = fopen("../test/bin/level1_test.bin", "rb");
+ FILE *fp = fopen("static/shop_new.bin", "rb");
if (fp == NULL) {
- printf("level1_test.bin not found!\n");
+ printf("shop_new.bin not found!\n");
return levels;
}
fseek(fp, 0, SEEK_END);
@@ -38,6 +42,19 @@ hh_g_all_levels hh_init_game_levels(){
fread(hh_game_level2, sizeof(int), size, lvl2);
fclose(lvl2);
+ FILE *shop = fopen("static/shop_new.bin", "rb");
+ if (shop == NULL) {
+ printf("shop.bin not found!\n");
+ return levels;
+ }
+ fseek(shop, 0, SEEK_END);
+ size = ftell(shop) / sizeof(int);
+ fseek(shop, (0 * sizeof(int)) + sizeof(int), SEEK_SET);
+ int* hh_game_shop = malloc(size * sizeof(int));
+ fread(hh_game_shop, sizeof(int), size, shop);
+ fclose(shop);
+
+ levels.shop.place = hh_game_shop;
levels.level[0].place = hh_game_level1;
levels.level[1].place = hh_game_level2;