P5.js movement logic — detective stops unexpectedly at corners in maze game

Welcome to the forum, and thanks for your first post!

I moved it to a more relevant category so others can find it more easily. I also formatted the code to make it easier to read. You can check out this short guide or the animation below for tips on formatting code in future posts.

Glad to have you here!

Raphaël

A screen recording showing how to format code on Discourse