From 3833577f79ac1e3851423208c404288b33530f0b Mon Sep 17 00:00:00 2001 From: hgn Date: Mon, 10 Jan 2022 18:03:42 +0000 Subject: [PATCH] cleaned up world edges --- fishladder.c | 8 +++++++- fishladder_resources.h | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/fishladder.c b/fishladder.c index c3f83a7..a568516 100644 --- a/fishladder.c +++ b/fishladder.c @@ -917,7 +917,13 @@ static int map_load( const char *str, const char *name ) { u8 *px = &info_buffer[((x*64)+y)*4]; - px[0] = 0xFF-0x3F + hash21i( (v2i){x,y}, 0x3F ); + int dist_x = 16 - VG_MIN( VG_MIN( x, 16 ), 16-VG_MAX( x-16-world.w, 0 ) ); + int dist_y = 16 - VG_MIN( VG_MIN( y, 16 ), 16-VG_MAX( y-16-world.h, 0 ) ); + int dist = VG_MAX( dist_x, dist_y ) * 16; + + int value = VG_MAX( 0, 0xFF-0x3F + hash21i( (v2i){x,y}, 0x3F ) - dist ); + + px[0] = value; px[1] = 0; px[2] = 0; px[3] = 0; diff --git a/fishladder_resources.h b/fishladder_resources.h index c6ecc9a..f0371c1 100644 --- a/fishladder_resources.h +++ b/fishladder_resources.h @@ -899,18 +899,39 @@ static struct cmp_level cmp_levels_grad[] = .map_name = "cmp_grad", .description = "", - ._linked = 22 + ._linked = 22, + ._unlock = 23 }, // r2 GM { .serial_id = 22, .title = "SECRET CODE", .map_name = "cmp_secret", + .description = "", + + ._unlock = 23 + } +}; + +static struct cmp_level cmp_levels_computer[] = +{ + { + .serial_id = 23, + .title = "3 BIT BINARY", + .map_name = "cmp_binary", + .description = "", + + ._unlock = 24 + }, + { + .serial_id = 24, + .title = "3 BIT ADDITION", + .map_name = "cmp_add3b", .description = "" } }; -#define NUM_CAMPAIGN_LEVELS (vg_list_size( cmp_levels_tutorials ) + vg_list_size( cmp_levels_basic ) + vg_list_size( cmp_levels_grad )) +#define NUM_CAMPAIGN_LEVELS (vg_list_size( cmp_levels_tutorials ) + vg_list_size( cmp_levels_basic ) + vg_list_size( cmp_levels_grad ) + vg_list_size( cmp_levels_computer ) ) static struct career_level_pack { @@ -943,6 +964,13 @@ career_packs[] = .primary_colour = { 0.553f, 0.345f, 0.204f }, .origin = { -5, 6 }, .dims = { 4, 1 } + }, + { + .pack = cmp_levels_computer, + .count = vg_list_size( cmp_levels_computer ), + .primary_colour = { 0.75f, 0.23f, 0.39f }, + .origin = { -5, 8 }, + .dims = { 5, 1 } } }; -- 2.25.1