run indicator
authorhgn <hgodden00@gmail.com>
Sun, 12 Dec 2021 17:22:09 +0000 (17:22 +0000)
committerhgn <hgodden00@gmail.com>
Sun, 12 Dec 2021 17:22:09 +0000 (17:22 +0000)
fishladder.c
fishladder_resources.h
maps/cmp_b01.map
maps/cmp_b04.map [new file with mode: 0644]
maps/cmp_b05.map [new file with mode: 0644]
maps/cmp_b06.map [new file with mode: 0644]
maps/cmp_b07.map [new file with mode: 0644]
maps/cmp_b09.map [new file with mode: 0644]
maps/cmp_b11.map [new file with mode: 0644]
maps/cmp_not.map [new file with mode: 0644]

index 18332b5dd23f38621fbdce76a0d41d225118f81a..deea9791ea0762bab88c7d97461ab6504eeea0ce 100644 (file)
@@ -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 );
                        }
index 29e7f3eebb448474b95960faceb812a10e625a3a..5851b5e3bb282485c95e9464cde07804c8932536 100644 (file)
@@ -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",
index ccb9765add80886cce1887e2e1dd71ec1ec962d3..9c548b3685b6597bd2d421fff818efd7f642c786 100644 (file)
@@ -1,7 +1,7 @@
 #############;
-###-#####-##$;a,aaa
-##         #$;
-##         #$;
+###-#####-###;a,aaa
+##         ##;
+##         ##;
 ##         ##;
 ##         ##;
 ##         ##;
diff --git a/maps/cmp_b04.map b/maps/cmp_b04.map
new file mode 100644 (file)
index 0000000..0f3ec63
--- /dev/null
@@ -0,0 +1,12 @@
+#############;
+######-######;aac
+##         ##;
+###       ###;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+###       ###;
+##         ##;
+######+######;aacc
+#############;
diff --git a/maps/cmp_b05.map b/maps/cmp_b05.map
new file mode 100644 (file)
index 0000000..c3022e2
--- /dev/null
@@ -0,0 +1,12 @@
+#############;
+######-######;abab
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+###+#####+###;aa,bb
+#############;
diff --git a/maps/cmp_b06.map b/maps/cmp_b06.map
new file mode 100644 (file)
index 0000000..df94449
--- /dev/null
@@ -0,0 +1,14 @@
+#################;
+#######-#########;abccba
+##             ##;
+##             ##;
+##             ##;
+##             ##;
+##             ##;
+##             ##;
+##             ##;
+##             ##;
+##             ##;
+##             ##;
+####+###+###+####;aa,bb,cc
+#################;
diff --git a/maps/cmp_b07.map b/maps/cmp_b07.map
new file mode 100644 (file)
index 0000000..915a949
--- /dev/null
@@ -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 (file)
index 0000000..7e2c727
--- /dev/null
@@ -0,0 +1,13 @@
+###############;
+####-##########;abcb:ccaa
+##           ##;
+##           ##;
+##           ##;
+##           ##;
+##           ##;
+##           ##;
+##           ##;
+##           ##;
+##           ##;
+##########+####;bcba:aacc
+###############;
diff --git a/maps/cmp_b11.map b/maps/cmp_b11.map
new file mode 100644 (file)
index 0000000..5154c5e
--- /dev/null
@@ -0,0 +1,5 @@
+###########;
+##-#####-##;a,aa
+##       ##;
+#####+#####;aaa
+###########;
diff --git a/maps/cmp_not.map b/maps/cmp_not.map
new file mode 100644 (file)
index 0000000..4bb2855
--- /dev/null
@@ -0,0 +1,8 @@
+#############;
+######-######;:c:
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+####+###+####;a::a,c:c:c
+#############;