struct cell_terminal *terminal = &world.io[ reg_start ];
struct terminal_run *run = &terminal->runs[ terminal->run_count-1 ];
- if( *c >= 'a' && *c <= 'z' )
+ if( (*c >= 'a' && *c <= 'z') || *c == ' ' )
{
run->conditions[ run->condition_count ++ ] = *c;
}
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;
while( world.sim_frame < world.sim_target )
{
- sfx_set_playrnd( &audio_random, &audio_system_balls_switching, 0, 9 );
+ sfx_set_playrnd( &audio_random, &audio_system_balls_switching, 0, 8 );
// Update splitter deltas
for( int i = 0; i < world.h*world.w; i ++ )
{
if( world.sim_frame < term->runs[ world.sim_run ].condition_count )
{
+ char emit = term->runs[ world.sim_run ].conditions[ world.sim_frame ];
+ if( emit == ' ' )
+ continue;
+
struct fish *fish = &world.fishes[ world.num_fishes ];
v2i_copy( term->pos, fish->pos );
fish->state = k_fish_state_alive;
- fish->payload = term->runs[ world.sim_run ].conditions[ world.sim_frame ];
+ fish->payload = emit;
struct cell *cell_ptr = pcell( fish->pos );
{
btn->pressed ^= 0x1;
}
+
+ sfx_set_play( &audio_clicks, &audio_system_ui, btn->pressed?1:0 );
}
// Drawing
{
float death_anim_time = world.sim_internal_time - fish->death_time;
+ // Death animation
if( death_anim_time > 0.0f && death_anim_time < 1.0f )
{
- // Death animation
- v2_muladds( fish->physics_co, fish->physics_v, -1.0f * world.sim_internal_delta, fish->physics_co );
- render_pos[2] = 1.0f - death_anim_time;
-
- //fish->physics_co[0] = fish->pos[0] + 0.5f + sinf( vg_time * 40.0f );
- //fish->physics_co[1] = fish->pos[1] + 0.5f + cosf( vg_time * 45.0f );
+ float amt = 1.0f-death_anim_time*death_anim_time;
+
+ v2_muladds( fish->physics_co, fish->physics_v, -1.0f * world.sim_internal_delta * amt, fish->physics_co );
+ render_pos[2] = amt;
}
else if( world.sim_internal_time > fish->death_time )
continue;
(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 );
}
if( is_input )
{
- colour_code_v3( term->runs[k].conditions[j], dot_colour );
- glUniform4fv( SHADER_UNIFORM( shader_tile_colour, "uColour" ), 1, dot_colour );
-
- // Draw filled if tick not passed, draw empty if empty
- if( (world.sim_frame > j && world.sim_run >= k) || world.sim_run > k )
- draw_mesh( empty_start, empty_count );
- else
- draw_mesh( filled_start, filled_count );
+ char cc = term->runs[k].conditions[j];
+ if( cc != ' ' )
+ {
+ colour_code_v3( cc, dot_colour );
+ glUniform4fv( SHADER_UNIFORM( shader_tile_colour, "uColour" ), 1, dot_colour );
+
+ // Draw filled if tick not passed, draw empty if empty
+ if( (world.sim_frame > j && world.sim_run >= k) || world.sim_run > k )
+ draw_mesh( empty_start, empty_count );
+ else
+ draw_mesh( filled_start, filled_count );
+ }
}
else
{
for( int i = 0; i < 3; i ++ )
{
- if( i == pack_selection )
+ int pack_is_unlocked = pack_infos[i].levels[0].unlocked;
+
+ if( i == pack_selection || !pack_is_unlocked )
gui_override_colours( &flcol_list_locked );
-
- if( gui_button( 2000 + i ) == k_button_click )
+
+ if( gui_button( 2000 + i ) == k_button_click && pack_is_unlocked )
pack_selection = i;
ui_global_ctx.cursor[1] += 2;
- gui_text( pack_infos[i].name, 4, 0 );
+ gui_text( pack_is_unlocked? pack_infos[i].name: "???", 4, 0 );
gui_end_right();
gui_reset_colours();