Update editor scene to be larger

also prevent last row to be modified
scene_man
En Yi 2023-08-19 20:33:31 +08:00
parent 7dcc142a2d
commit e2bce62a9d
3 changed files with 4 additions and 2 deletions

View File

@ -54,8 +54,10 @@ int main(void)
change_scene(&engine, 0);
#if defined(PLATFORM_WEB)
puts("Setting emscripten main loop");
emscripten_set_main_loop(update_loop, 0, 1);
#else
puts("Regular main loop");
while(true)
{

View File

@ -4,7 +4,7 @@
#ifndef TILE16_SIZE
#define TILE_SIZE 32
#define DEFAULT_MAP_WIDTH 48
#define DEFAULT_MAP_HEIGHT 22
#define DEFAULT_MAP_HEIGHT 32
#define VIEWABLE_MAP_WIDTH 32
#define VIEWABLE_MAP_HEIGHT 16
#else

View File

@ -493,7 +493,7 @@ static void toggle_block_system(Scene_t* scene)
{
Vector2 mouse_pos = GetScreenToWorld2D(raw_mouse_pos, data->cam);
unsigned int tile_idx = get_tile_idx(mouse_pos.x, mouse_pos.y, &tilemap);
if (tile_idx >= MAX_N_TILES) return;
if (tile_idx >= (tilemap.n_tiles - tilemap.width)) return;
if (tile_idx == last_tile_idx) return;
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON))