Tuesday, September 12, 2023

The City Map Game

I really like the game SF-Street-Names, which I reviewed Monday in the post The Streets of San Francisco Game

In fact I liked SF-Street-Names so much that I immediately started trying to see if I could replicate the game for a different city. The result is the Streets of Winchelsea. In this very scaled back version of the SF-Street-Names game you have to name all of the 17 streets of the small English town of Winchelsea (and you will probably need to be one of the town's 600 residents to get more than one or two streets correct).

After completing the Streets of Winchlesea I decided it would be easier to create a map game in which players have to name cities rather than streets. In SF-Street-Names lots of co-ordinates need to be stored for every single street polyline. For cities you only need to store one co-ordinate for each city - the latitude and longitude of the geographic center of the city. 

I have therefore decided to 'borrow' the game-play idea from SF-Street-Names for a 'name the cities' type game. So far I have created two city games (Scotland & Wales), and one 'name the states' game:

US State Names
Scottish City Names
Welsh City Names 

In US State Names you have to type in the names of all 50 US states. Each time you type in a correct state that state will be labeled on the map (the US state version of the game highlights some problems with the place-name labeling code I'm using - at the moment the state labels are appearing offset from the state centroids).

In Scottish City Names you have to type in the names of Scottish cities. Every time that you type in a correct city name then that city is labeled on the interactive map. Your task is to label all 8 Scottish cities.

In the Welsh version of the game you have to name all 7 Welsh cities (apologies to Welsh speakers as the game only recognizes the English names not the Welsh language city names).  

In the Streets of Winchelsea game you have to enter the names of the town's 17 streets. In the game you only have to type in the first part of the name (you don't need to type in the designation 'Road', 'Street', 'Hill', 'Lane' etc).

I am in massive debt to Map Channels for helping me create these games. The fact that these games even work is thanks to his amazing work at fixing and improving my awful code.

Cloning the Game

If you want to create a similar game for any other country in the world (you know one with a few more cities) then you can clone the project on Glitch

After cloning the game all you really need to do is change the data in the places.js file to your own data. The game will then automatically work with your data.

You will also probably want to re-center the map to show the area containing your data. You can change the latitude and longitude of the map on line 25 of the main.js file. 

You might also want to change the title of the map (the text that appears in the browser tab). You can do this on line 64 of the main.js file.

If you do create a game for another country or state then leave a link to your game in the comments and I'll add the link to the games listed in this post.

No comments:

Post a Comment