diff --git a/assets/tiles/down.png b/assets/tiles/arrow_down.png similarity index 100% rename from assets/tiles/down.png rename to assets/tiles/arrow_down.png diff --git a/assets/tiles/left.png b/assets/tiles/arrow_left.png similarity index 100% rename from assets/tiles/left.png rename to assets/tiles/arrow_left.png diff --git a/assets/tiles/right.png b/assets/tiles/arrow_right.png similarity index 100% rename from assets/tiles/right.png rename to assets/tiles/arrow_right.png diff --git a/assets/tiles/up.png b/assets/tiles/arrow_up.png similarity index 100% rename from assets/tiles/up.png rename to assets/tiles/arrow_up.png diff --git a/src/main.rs b/src/main.rs index 79498c8..b9c5af7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -80,14 +80,13 @@ fn main() { let mut d = rl.begin_drawing(&thread); d.clear_background(Color::new(64, 64, 64, 255)); game.gui(&mut d, &textures); - d.draw_fps(2, 2); } } impl Game { fn new_sandbox() -> Self { Self { - source_board: Board::new_empty(1, 1), + source_board: Board::new_empty(16, 16), machine: Machine::new_empty(1), sim_state: SimState::Editing, view_offset: Vector2::zero(), @@ -174,7 +173,7 @@ impl Game { self.draw_board(d, textures); let height = d.get_screen_height(); - let footer_height = 100; + let footer_height = 95; let footer_top = (height - footer_height) as f32; d.draw_rectangle( 0, @@ -228,7 +227,7 @@ impl Game { texture_button( d, Vector2 { - x: 300. + col as f32 * bound_offset, + x: 300. + col as f32 * bound_offset - if col < 0 { 15. } else { 0. }, y: footer_top + 5. + row as f32 * bound_offset, }, textures.get(texture), @@ -241,9 +240,13 @@ impl Game { tool_button((0, -1), "eraser", Tool::SetTile(tile_to_char(' '))); tool_button((1, -1), "", Tool::None); - tool_button((0, 0), "block", Tool::SetTile(tile_to_char('#'))); - tool_button((0, 1), "bag_off", Tool::SetTile(tile_to_char('B'))); - tool_button((0, 2), "trigger_off", Tool::SetTile(tile_to_char('*'))); + tool_button((0, 0), "marble", Tool::SetTile(tile_to_char('o'))); + tool_button((0, 1), "block", Tool::SetTile(tile_to_char('#'))); + tool_button((0, 2), "bag_off", Tool::SetTile(tile_to_char('B'))); + tool_button((0, 3), "trigger_off", Tool::SetTile(tile_to_char('*'))); + tool_button((0, 4), "input_off", Tool::SetTile(tile_to_char('I'))); + tool_button((0, 5), "output_off", Tool::SetTile(tile_to_char('P'))); + tool_button((0, 6), "flipper_off", Tool::SetTile(tile_to_char('F'))); tool_button( (1, 0), @@ -256,6 +259,10 @@ impl Game { Tool::SetTile(tile_to_char('|')), ); tool_button((1, 2), "wire_cross_off", Tool::SetTile(tile_to_char('+'))); + tool_button((1, 3), "arrow_up", Tool::SetTile(tile_to_char('^'))); + tool_button((1, 4), "arrow_down", Tool::SetTile(tile_to_char('v'))); + tool_button((1, 5), "arrow_left", Tool::SetTile(tile_to_char('<'))); + tool_button((1, 6), "arrow_right", Tool::SetTile(tile_to_char('>'))); let mouse_pos = d.get_mouse_position(); if self.sim_state == SimState::Editing && mouse_pos.y < footer_top { diff --git a/src/marble_engine/tile.rs b/src/marble_engine/tile.rs index 7c2da37..11df1ab 100644 --- a/src/marble_engine/tile.rs +++ b/src/marble_engine/tile.rs @@ -103,10 +103,10 @@ impl Tile { MirrorType::Back => "mirror_back", }, Tile::Arrow(dir) => match dir { - Direction::Up => "up", - Direction::Down => "down", - Direction::Left => "left", - Direction::Right => "right", + Direction::Up => "arrow_up", + Direction::Down => "arrow_down", + Direction::Left => "arrow_left", + Direction::Right => "arrow_right", }, Tile::Powerable(tile, state) => { let root = match tile {