Games on Device Misread "\\" in Strings

The simulator properly treats "\\" in strings as a single "\" key. This can be used to load files from the game's directory without error. However, when uploading to the device, loading an image with a "\\" in its path leads to an error, stating that the file was not found. This is an unexpected behavior and (since the "file not found" error could be caused in many different ways) could lead to a developer running around in circles trying to figure out why their game isn't working.

I'm not sure why/how this is happening, but I'm certain it would be a trivial fix for someone more comfortable with the device-side of the Playdate.

1 Like

On both the Simulator and device you're supposed to use the forward slash (/) as a path separator. The Sim should convert it to your native system path separator when a file function is called.

1 Like