From: hgn Date: Sun, 12 Dec 2021 17:22:09 +0000 (+0000) Subject: run indicator X-Git-Url: https://harrygodden.com/git/?p=fishladder.git;a=commitdiff_plain;h=5293bf2e9c4f30d5b01f1e1638c00509c1674768 run indicator --- diff --git a/fishladder.c b/fishladder.c index 18332b5..deea979 100644 --- a/fishladder.c +++ b/fishladder.c @@ -745,6 +745,9 @@ static int map_load( const char *str, const char *name ) turtle_dir[1] = pcell(term->pos)->state & FLAG_INPUT? 1: -1; original_y = turtle_dir[1]; + info_buffer[((turtle[1]*64)+turtle[0])*4] = 0; + v2i_add( turtle_dir, turtle, turtle ); + for( int i = 0; i < 100; i ++ ) { info_buffer[((turtle[1]*64)+turtle[0])*4] = 0; @@ -2294,9 +2297,35 @@ void vg_render(void) (arr_base + (float)term->pos[1] + (float)(term->run_count-1)*0.2f) - run_offset: (float)term->pos[1] + arr_base + run_offset; - if( k & 0x1 ) + v4f bar_colour; + int bar_draw = 0; + + if( is_simulation_running() ) + { + if( k == world.sim_run ) + { + float a = fabsf(sinf( vg_time * 2.0f )) * 0.075f + 0.075f; + + v4_copy( (v4f){ 1.0f, 1.0f, 1.0f, a }, bar_colour ); + } + else + v4_copy( (v4f){ 0.0f, 0.0f, 0.0f, 0.13f }, bar_colour ); + + bar_draw = 1; + } + else if( 1 || k & 0x1 ) + { + if( k & 0x1 ) + v4_copy( (v4f){ 1.0f, 1.0f, 1.0f, 0.07f }, bar_colour ); + else + v4_copy( (v4f){ 0.0f, 0.0f, 0.0f, 0.13f }, bar_colour ); + + bar_draw = 1; + } + + if( bar_draw ) { - glUniform4f( SHADER_UNIFORM( shader_tile_colour, "uColour" ), 1.0f, 1.0f, 1.0f, 0.1f ); + glUniform4fv( SHADER_UNIFORM( shader_tile_colour, "uColour" ), 1, bar_colour ); glUniform3f( SHADER_UNIFORM( shader_tile_colour, "uOffset" ), (float)term->pos[0], y_position - 0.1f, 1.0f ); draw_mesh( 2, 2 ); } diff --git a/fishladder_resources.h b/fishladder_resources.h index 29e7f3e..5851b5e 100644 --- a/fishladder_resources.h +++ b/fishladder_resources.h @@ -681,7 +681,20 @@ static struct cmp_level cmp_levels_tutorials[] = static struct cmp_level cmp_levels_basic[] = { - // r1 + // r2 GM + { + .serial_id = 6, + .title = "PATCH", + .map_name = "cmp_b04", + .description = "For some reason, the division module our\n" + "intern built for us is sending twice as many\n" + "yellows as needed. We need to send the\n" + "excess to be recycled!", + + ._unlock = 7, + ._linked = 3 + }, + // r1 GM { .serial_id = 3, .title = "SUBDIVISION 1", @@ -690,19 +703,18 @@ static struct cmp_level cmp_levels_basic[] = "dividing up the input and recombining it.", ._linked = 4, - ._unlock = 6 + ._unlock = 5 }, - // r1 + // r1 GM { .serial_id = 4, .title = "SUBDIVISION 2", .map_name = "cmp_b02", .description = "", - ._linked = 5, ._unlock = 7 }, - // r1 + // r1 GM { .serial_id = 5, .title = "RESTRUCTURE", @@ -712,14 +724,7 @@ static struct cmp_level cmp_levels_basic[] = ._unlock = 8 }, - { - .serial_id = 6, - .title = "SERIALIZE", - .map_name = "cmp_b04", - .description = "Merge and sort", - - ._unlock = 7 - }, + // r2 GM { .serial_id = 7, .title = "PATTERNS 1", @@ -728,40 +733,16 @@ static struct cmp_level cmp_levels_basic[] = ._linked = 8 }, + // r2 GM { .serial_id = 8, .title = "PATTERNS 2", .map_name = "cmp_b06", .description = "Replicate MORE", - ._unlock = 9 - }, - { - .serial_id = 9, - .title = "MIGHTY CONSUMER", - .map_name = "cmp_b07", - .description = "Build a greedy system", - - ._linked = 10, - ._unlock = 11 - }, - { - .serial_id = 10, - .title = "ENCRYPTED 1", - .map_name = "cmp_b08", - .description = "Some configurations may not be valid", - - ._unlock = 15 - }, - { - .serial_id = 11, - .title = "REVERSE", - .map_name = "cmp_b09", - .description = "Reverse the incoming order. Always length 4", - ._unlock = 15 }, - // r2 + // r2 GM { .serial_id = 15, .title = "PRINCIPLE 5", @@ -777,7 +758,7 @@ static struct cmp_level cmp_levels_basic[] = ._unlock = 16, .is_tutorial = 1 }, - // r2 + // r2 GM { .serial_id = 16, .title = "ROUTING PROBLEM", @@ -786,33 +767,54 @@ static struct cmp_level cmp_levels_basic[] = "Things can get a little chaotic on tight boards, do your\n" "best to utilize principle 5 to get the job done\n", + ._linked = 9 + }, + // r2 GM + { + .serial_id = 9, + .title = "MIGHTY CONSUMER", + .map_name = "cmp_b07", + .description = "Build a greedy system", + + ._linked = 10, + ._unlock = 11 + }, + { + .serial_id = 10, + .title = "ENCRYPTED 1", + .map_name = "cmp_b08", + .description = "Some configurations may not be valid", + + ._unlock = 17 + }, + // r2 GM + { + .serial_id = 11, + .title = "REVERSE", + .map_name = "cmp_b09", + .description = "Reverse the incoming order. Always length 4", + ._unlock = 17 }, + // r2 GM { .serial_id = 17, .title = "PRINCIPLE 6", .map_name = "cmp_b11", .description = - "While hovering over a simple tile peice, right click and\n" - "drag to start creating a wire. These can be connected to\n" - "the left, or right recieving pins of a Twisty Turny(TM).\n" - "\n" - "Once connected, the Twisty Turny(TM) will no longer\n" - "'flip flop' as marbles run through them, but instead be\n" - "et to left or right rotating only. As indicated by the\n" - "status arrow beneath them\n" - "\n" - "When the left or right slot is triggered, the Twisty\n" - "Turny(TM) will switch modes according to that input.\n" + "Usually the splitter piece will flip flop between left\n" + "and right, however it can be forced to only rotate in\n" + "one direction if trigger wires are attached.\n" "\n" - "Trigger wires apply instantaneously, however if both the\n" - "left and right inputs are recieved at the same time,\n" - "this results in no operation being performed, and no\n" - "state changes take place in the Twisty Turny(TM)\n", + "Right click and drag from a regular block, and attach it\n" + "to a splitter. This creates a trigger.\n" + "The default state is left, and once a marble hits the\n" + "trigger it will switch to rotating that direction.", ._unlock = 18, .is_tutorial = 1 }, + // r2 GM { .serial_id = 18, .title = "NOT GATE", diff --git a/maps/cmp_b01.map b/maps/cmp_b01.map index ccb9765..9c548b3 100644 --- a/maps/cmp_b01.map +++ b/maps/cmp_b01.map @@ -1,7 +1,7 @@ #############; -###-#####-##$;a,aaa -## #$; -## #$; +###-#####-###;a,aaa +## ##; +## ##; ## ##; ## ##; ## ##; diff --git a/maps/cmp_b04.map b/maps/cmp_b04.map new file mode 100644 index 0000000..0f3ec63 --- /dev/null +++ b/maps/cmp_b04.map @@ -0,0 +1,12 @@ +#############; +######-######;aac +## ##; +### ###; +## ##; +## ##; +## ##; +## ##; +### ###; +## ##; +######+######;aacc +#############; diff --git a/maps/cmp_b05.map b/maps/cmp_b05.map new file mode 100644 index 0000000..c3022e2 --- /dev/null +++ b/maps/cmp_b05.map @@ -0,0 +1,12 @@ +#############; +######-######;abab +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +###+#####+###;aa,bb +#############; diff --git a/maps/cmp_b06.map b/maps/cmp_b06.map new file mode 100644 index 0000000..df94449 --- /dev/null +++ b/maps/cmp_b06.map @@ -0,0 +1,14 @@ +#################; +#######-#########;abccba +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +####+###+###+####;aa,bb,cc +#################; diff --git a/maps/cmp_b07.map b/maps/cmp_b07.map new file mode 100644 index 0000000..915a949 --- /dev/null +++ b/maps/cmp_b07.map @@ -0,0 +1,14 @@ +#################; +##-##-##-##-##-##;aaa,a,aaaaa,aa,aaa +## ##; +## ##; +## ##; +## ##; +## ### ##; +## ### ##; +## ##; +## ##; +## ##; +## ##; +##+##+#+#+#+##+##;aa,aaaa,aa,a,aaaa,a +#################; diff --git a/maps/cmp_b09.map b/maps/cmp_b09.map new file mode 100644 index 0000000..7e2c727 --- /dev/null +++ b/maps/cmp_b09.map @@ -0,0 +1,13 @@ +###############; +####-##########;abcb:ccaa +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +## ##; +##########+####;bcba:aacc +###############; diff --git a/maps/cmp_b11.map b/maps/cmp_b11.map new file mode 100644 index 0000000..5154c5e --- /dev/null +++ b/maps/cmp_b11.map @@ -0,0 +1,5 @@ +###########; +##-#####-##;a,aa +## ##; +#####+#####;aaa +###########; diff --git a/maps/cmp_not.map b/maps/cmp_not.map new file mode 100644 index 0000000..4bb2855 --- /dev/null +++ b/maps/cmp_not.map @@ -0,0 +1,8 @@ +#############; +######-######;:c: +## ##; +## ##; +## ##; +## ##; +####+###+####;a::a,c:c:c +#############;